by siempre.aprendiendo » Thu Jul 18, 2013 12:34 pm
by siempre.aprendiendo
Thu Jul 18, 2013 12:34 pm
Javi asked for help in the Robotis forumtrying to use Qt Creator (MinGW) with the Zigbee SDK.
As I think Qt is a great (IMHO, the best) alternative to VC++ in Windows and a great tool in Linux (IMHO, also the best for UI development) I have been testing a little and found this solution to the problem opening the Zigbee connection, throw the Zig2Serial:
It seems a problem with the char* type when calling CreateFile in zgb_hal.c (from int zgb_hal_open( int devIndex, float baudrate ) ), CreateFile needs a wide char pointer.
With these changes, it works to me:
- Code: Select all
wchar_t port[20];
swprintf (port, 20, L"%hs",PortName);
ghSerial_Handle = CreateFile( port, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
Probably VC++ does this change automatically.
Hope it helps you embracing Qt and Linux!!
Javi asked for help in the Robotis forumtrying to use Qt Creator (MinGW) with the Zigbee SDK.
As I think Qt is a great (IMHO, the best) alternative to VC++ in Windows and a great tool in Linux (IMHO, also the best for UI development) I have been testing a little and found this solution to the problem opening the Zigbee connection, throw the Zig2Serial:
It seems a problem with the char* type when calling CreateFile in zgb_hal.c (from int zgb_hal_open( int devIndex, float baudrate ) ), CreateFile needs a wide char pointer.
With these changes, it works to me:
- Code: Select all
wchar_t port[20];
swprintf (port, 20, L"%hs",PortName);
ghSerial_Handle = CreateFile( port, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
Probably VC++ does this change automatically.
Hope it helps you embracing Qt and Linux!!