Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Qt (MinGW) and Zigbee SDK

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
1 postPage 1 of 1
1 postPage 1 of 1

Qt (MinGW) and Zigbee SDK

Post by siempre.aprendiendo » Thu Jul 18, 2013 12:34 pm

Post 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!!
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

1 postPage 1 of 1
1 postPage 1 of 1