Added udsGetNetworkStructApplicationData().

This commit is contained in:
yellows8 2016-04-05 17:37:07 -04:00
parent 9ad6e0945c
commit db6432ce0a
2 changed files with 20 additions and 0 deletions

View File

@ -184,6 +184,14 @@ Result udsSetApplicationData(u8 *buf, u32 size);
*/
Result udsGetApplicationData(u8 *buf, u32 size, u32 *actual_size);
/**
* @brief This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.
* @param buf Appdata buffer.
* @param size Max size of the output buffer.
* @param actual_size If set, the actual size of the appdata written into the buffer is stored here.
*/
Result udsGetNetworkStructApplicationData(udsNetworkStruct *network, u8 *buf, u32 size, u32 *actual_size);
/**
* @brief Create a bind.
* @param bindcontext The output bind context.

View File

@ -662,6 +662,18 @@ Result udsGetApplicationData(u8 *buf, u32 size, u32 *actual_size)
return ret;
}
Result udsGetNetworkStructApplicationData(udsNetworkStruct *network, u8 *buf, u32 size, u32 *actual_size)
{
if(network->appdata_size > sizeof(network->appdata))return -1;
if(size > network->appdata_size)size = network->appdata_size;
if(buf)memcpy(buf, network->appdata, size);
if(actual_size)*actual_size = size;
return 0;
}
static Result udsipc_Bind(udsBindContext *bindcontext, u32 input0, u8 input1, u16 NetworkNodeID)//input0 and input1 are unknown.
{
u32* cmdbuf=getThreadCommandBuffer();