Changeset 331 in flair-src for trunk/lib/FlairSensorActuator/src
- Timestamp:
- Oct 1, 2019, 4:45:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp
r330 r331 131 131 liteObject_t tmp; 132 132 tmp.vrpnobject = obj; 133 tmp.id =liteObjects.size();133 uint16_t id=liteObjects.size(); 134 134 mutex->GetMutex(); 135 135 liteObjects.push_back(tmp); … … 137 137 //Printf("%i %s\n",tmp.id,obj->self->ObjectName().c_str()); 138 138 139 char char_array[obj->self->ObjectName().length() + 2];//id coded on 16bits 140 strcpy(char_array, obj->self->ObjectName().c_str()); 141 uint16_t* idPtr=(uint16_t*)&char_array[obj->self->ObjectName().length()]; 142 *idPtr=tmp.id; 143 dataSocket->HostToNetwork((char*)idPtr,sizeof(uint16_t)); 144 dataSocket->SendMessage(char_array,obj->self->ObjectName().length() + 2); 139 char char_array[obj->self->ObjectName().length() + sizeof(id)]; 140 strcpy(char_array, obj->self->ObjectName().c_str()); 141 dataSocket->HostToNetwork((char*)(&id),sizeof(id)); 142 memcpy(&char_array[obj->self->ObjectName().length()],&id,sizeof(id)); 143 dataSocket->SendMessage(char_array,obj->self->ObjectName().length() + sizeof(id)); 145 144 }else { 146 145 self->Warn("too much trackables for vrpnlite connection, not adding %s\n",obj->self->ObjectName().c_str());
Note:
See TracChangeset
for help on using the changeset viewer.