I am trying to port a Zuno sketch to Zuno2 using the 3.0.7 toolchain. The following piece of code seems to break:
Code: Select all
ZUNO_REPORTS_HANDLER(Notification, notificationReportHandler);
...
...
void notificationReportHandler() {
#if defined SERIAL_DEBUG && defined DEBUG_REPORT_HANDLER
Serial.print(REPORT_NOTIFICATION_STATUS(), HEX);
Serial.print(" TYPE:");
Serial.print(REPORT_NOTIFICATION_TYPE(), HEX);
Serial.print(" EVENT:");
Serial.print(REPORT_NOTIFICATION_EVENT(), HEX);
Serial.print(" PARAM:");
Serial.println(REPORT_NOTIFICATION_EVENT_PARAM(0), HEX);
#endif
byte type = REPORT_NOTIFICATION_TYPE();
byte event = REPORT_NOTIFICATION_EVENT();
byte param0 = REPORT_NOTIFICATION_EVENT_PARAM(0);
....
....
}
Code: Select all
#define REPORT_NOTIFICATION_STATUS(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.notificationStatus)
#define REPORT_NOTIFICATION_TYPE(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.notificationType)
#define REPORT_NOTIFICATION_EVENT(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.mevent)
#define REPORT_NOTIFICATION_PARAM_LENGTH(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.properties1 & NOTIFICATION_PROPERTIES_PARAMLENGTH_MASK)
#define REPORT_NOTIFICATION_EVENT_PARAM(report_data, N) (((uint8_t *)&(((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.eventParameter1))[N])
Error messages shown:
Code: Select all
[size=85]var/folders/_b/cl88zkv55sx9w89rk4tb6zhw0000gn/T/arduino_build_737389/zuno-rgbw-controller.ino: In function 'void notificationReportHandler()':
ReportHandler.h:75:101: error: expected primary-expression before '*' token
#define REPORT_NOTIFICATION_TYPE(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.notificationType)
^
/var/folders/_b/cl88zkv55sx9w89rk4tb6zhw0000gn/T/arduino_build_737389/zuno-rgbw-controller.ino:1238:15: note: in expansion of macro 'REPORT_NOTIFICATION_TYPE'
#endif
^
ReportHandler.h:75:102: error: expected primary-expression before ')' token
#define REPORT_NOTIFICATION_TYPE(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.notificationType)
^
/var/folders/_b/cl88zkv55sx9w89rk4tb6zhw0000gn/T/arduino_build_737389/zuno-rgbw-controller.ino:1238:15: note: in expansion of macro 'REPORT_NOTIFICATION_TYPE'
#endif
^
ReportHandler.h:76:102: error: expected primary-expression before '*' token
#define REPORT_NOTIFICATION_EVENT(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.mevent)
^
/var/folders/_b/cl88zkv55sx9w89rk4tb6zhw0000gn/T/arduino_build_737389/zuno-rgbw-controller.ino:1239:16: note: in expansion of macro 'REPORT_NOTIFICATION_EVENT'
//byte type, event, param0;
^~~~~~~~~~~~~~
ReportHandler.h:76:103: error: expected primary-expression before ')' token
#define REPORT_NOTIFICATION_EVENT(report_data) (((ZwNotificationReportFrame_t *)((ReportAuxData_t *)report_data)->rawReportData)->byte4.mevent)
^
/var/folders/_b/cl88zkv55sx9w89rk4tb6zhw0000gn/T/arduino_build_737389/zuno-rgbw-controller.ino:1239:16: note: in expansion of macro 'REPORT_NOTIFICATION_EVENT'
//byte type, event, param0;
^~~~~~~~~~~~~~
zuno-rgbw-controller:1240:17: error: 'REPORT_NOTIFICATION_EVENT_PARAM' was not declared in this scope
byte type = REPORT_NOTIFICATION_TYPE();
^~~~~~~~~~~~~~~~~~~~~~~~~
exit status 10
macro "REPORT_NOTIFICATION_EVENT_PARAM" requires 2 arguments, but only 1 given[/size]