From: Giulio Z. <Giu...@ir...> - 2008-01-28 10:54:52
|
Indeed, i can have a print before and after the PUBLISH, and this changes when the Tag is found, from the fake value 8796 to the real type stored for the moment in the Dummy variable. Any suggestion, the silly it may seem, can be helpful here, perheps it's just a misconfig or something I forgot. pre-PUBLISH; tags_count=0, dummy=8796 post-PUBLISH; tags_count=0, dummy=8796 pre-PUBLISH; tags_count=1, dummy=1099993531 post-PUBLISH; tags_count=1, dummy=1099993531 With the Debugger (default behavior first, and when Tag Found the other 2): [Switching to Thread -1266406512 (LWP 11939)] Breakpoint 2, Driver::Publish (this=0xbb2da30, addr= {host = 16777343, robot = 6665, interf = 56, index = 0}, queue=0x0, type=2 '\002', subtype=2 '\002', src=0xb4842340, len=8, timestamp=0x0) at driver.cc:183 183 if(timestamp) (gdb) c Continuing. post-PUBLISH; tags_count=0, dummy=8796 [Switching to Thread -1217201280 (LWP 11927)] Breakpoint 2, Driver::Publish (this=0xbac26d0, addr= {host = 16777343, robot = 6665, interf = 4, index = 0}, queue=0x0, type=1 '\001', subtype=1 '\001', src=0xbfdd84cc, len=28, timestamp=0x0) at driver.cc:183 183 if(timestamp) interface 57 56 type 3 2 subtype 3 2 warning : skipping message from 56:0 with unsupported type 2:2 [Switching to Thread -1266271344 (LWP 11633)] Breakpoint 2, Driver::Publish (this=0xbb2da30, addr= {host = 16777343, robot = 6665, interf = 56, index = 0}, queue=0x0, type=2 '\002', subtype=2 '\002', src=0xb4863340, len=8, timestamp=0x0) at driver.cc:183 183 if(timestamp) (gdb) c Continuing. post-PUBLISH; tags_count=1, dummy=1099993531 [Switching to Thread -1217066112 (LWP 11611)] Breakpoint 2, Driver::Publish (this=0xbac26d0, addr= {host = 16777343, robot = 6665, interf = 4, index = 0}, queue=0x0, type=1 '\001', subtype=1 '\001', src=0xbfbedadc, len=28, timestamp=0x0) at driver.cc:183 183 if(timestamp) On Sat, 2008-01-26 at 09:36 +1300, Toby Collett wrote: > Have you confirmed that the publish call is definitely being made on the > driver? either with a print statement or debugger? > > Toby > > Giulio Zecca wrote: > > Indeed they had but the problem is different. > > Both on Driver and on Client header I declared the opq_Rfid_Data struct > > witho only 2 integers in order not to have pointer and size problems. > > I also tried to send a CMD from Driver and Client, just in case, but it > > didn't work. > > Looking at the Output, seems like the Proxy is not receiving, as the > > output is blank, but I really don't understand where else I could > > manipulate that data, and how. > > > > OUTPUT: > > opqData.data_count = 8 > > opqData.data = > > opqProxy.GetCount() = 0 > > rfidData = 0xbfaa9374 > > &rfidData = 0xbfaa9344 > > rfidData->tags_count = 0 > > rfidData->dummy = 0 > > > > CLIENT CODE: > > typedef struct opq_Rfid_Data { > > uint32_t tags_count; > > int dummy; > > } opq_Rfid_Data_t; > > > > OpaqueProxy opqProxy(&robot, robotNumber); > > robot.Read(); > > opq_Rfid_Data_t * rfidData = new opq_Rfid_Data_t[PLAYER_RFID_MAX_TAGS]; > > player_opaque_data_t opqData; > > > > opqData.data_count = sizeof(opq_Rfid_Data_t); > > /**/cout << "opqData.data_count = " << opqData.data_count << endl; > > > > opqProxy.GetData(opqData.data);// SendCmd(&opqData);// > > /**/cout << "opqData.data = " << opqData.data << endl; > > > > /**/cout << "opqProxy.GetCount() = " << opqProxy.GetCount() << endl; > > > > rfidData = reinterpret_cast<opq_Rfid_Data_t*>(opqData.data); > > /**/cout << "rfidData = " << rfidData << endl; > > /**/cout << "&rfidData = " << &rfidData << endl; > > > > /**/cout << "rfidData->tags_count = " << rfidData->tags_count << endl; > > /**/cout << "rfidData->dummy = " << rfidData->dummy << endl; > > > > > > Any suggestions or pieces of code with Opaque Interface are welcome. > > Thanks > > > > > > On Fri, 2008-01-25 at 14:38 +1300, Toby Collett wrote: > > > >> Does the opq_Rfid_Data_t structure have any pointers in it, if so you > >> will need to calculate the size of the full data with the pointed too > >> parts and deep copy it... > >> > >> Toby > >> > >> On 25/01/2008, Giulio Zecca <Giu...@ir...> wrote: > >> I need to pass some custom data to the Client: I read > >> something about > >> Opaque Driver and Proxy and tried to do that way. > >> However, after some tries, I noticed that apparently nothing > >> is being > >> sent to the Proxy. > >> For ease of explication, I replicated the RFIDProxy structure > >> for the > >> test file. > >> I can't get to understand the mistake in that, so I ask at > >> first if it > >> is possible to do suc a thing and, if so, what are the > >> suggestions. > >> > >> You can find attached a piece of the (hopefully) relevant > >> code; if you > >> need more details just ask me. > >> Thanks anyway for your support. > >> Giulio > >> > >> > >> ON THE DRIVER: > >> this->Publish(this->device_addr, NULL, PLAYER_MSGTYPE_DATA, > >> PLAYER_OPAQUE_DATA_STATE, (void*)&opqRfidData, > >> sizeof(opqRfidData), > >> NULL); > >> CONFIG FILE: > >> driver > >> ( > >> name "..." > >> plugin "..." > >> requires ["simulation:0"] > >> provides ["rfid:3" "opaque:3"] > >> model_name "..." > >> ) |