Hi All,
I am attempting to use the SDK to write a Device that uses the Generic Serial Hardware Interface.
This device will be used to communicate to wireless devices I will build using Atmel hardware and BitCloud Zigbee stack.
From the logs I can see the notification list is "Generic Serial Data Received", and I can get the notifications.
However I am having trouble finding the rest of the information needed, such as:
- The names of data (szDataName) in the DataPack to read the data
- Information on the InterfaceArgumentPack to write to the Serial Interface
- Other details I need that I don't know I need yet.
Thanks for any help,
- Ed
Information to work with Generic Serial Hardware Interface
Re: Information to work with Generic Serial Hardware Interface
Ed,
From the Device subscription notification method, you can access "Raw Data" or "Hex Data" from the argument pack.
Sending data to the interface is done like:
Finding the 'pCommand' object for the snippet above, can be done with:
Hopefully this should get you over the hurtle. If you have more questions, feel free to ask more.
From the Device subscription notification method, you can access "Raw Data" or "Hex Data" from the argument pack.
Sending data to the interface is done like:
Code: Select all
//
// Construct the Interface Argument Pack
InterfaceArgumentPack Pack;
//
// Setup the Pack
Pack.m_nArgumentPackVersion = INTERFACE_PACK_VERSION;
Pack.m_szInterfaceSignature = "SendSerialCommand( Command, [Argument1] )";
Pack.m_nNumberOfArguments = 2;
Pack.m_aArguments = new InterfaceArgument[ 2 ];
//
// Assign the arguments.
Pack.m_aArguments[ 0 ].m_atType = atStringValue;
Pack.m_aArguments[ 0 ].m_szStringValue = pCommand->m_szCommand;
Pack.m_aArguments[ 1 ].m_atType = atStringValue;
Pack.m_aArguments[ 1 ].m_szStringValue = szValue;
HARDWARE_RC rc = SendInterfacePackToInterface( &Pack );
Code: Select all
//
// See if there is a map for this value.
if ((pProperty->GetGenericCommandsAssociatedWithValue( pValue, NULL, &dwBuffSize )) &&
(dwBuffSize))
{
//
// Allocate the array memory
GenericCommand* pCommandArray = (GenericCommand*)malloc( dwBuffSize );
BOOL bRc = FALSE;
pProperty->GetGenericCommandsAssociatedWithValue( pValue, pCommandArray, &dwBuffSize );
Scott