35 #include "ace/SOCK_Dgram.h"
41 #include "EoMotionControl.h"
42 #include "eODeb_eoProtoParser.h"
43 #include "eOtheEthLowLevelParser.h"
80 static void my_cbk_onErrorSeqNum(eOethLowLevParser_packetInfo_t *pktInfo_ptr, uint32_t rec_seqNum, uint32_t expected_seqNum);
81 static void my_cbk_onNVfound(eOethLowLevParser_packetInfo_t *pktInfo_ptr, eODeb_eoProtoParser_ropAdditionalInfo_t *ropAddInfo_ptr);
97 EO_INIT(.NVs2searchArray)
101 EO_INIT(.capacity) eODeb_eoProtoParser_maxNV2find,
102 EO_INIT(.itemsize)
sizeof(eODeb_eoProtoParser_nvidEp_couple_t),
114 EO_INIT(.invalidRopFrame)
159 static void my_cbk_onErrorSeqNum(eOethLowLevParser_packetInfo_t *pktInfo_ptr, uint32_t rec_seqNum, uint32_t expected_seqNum)
162 printf(
"ERR in SEQNUM; rec=%d expected=%d\n",rec_seqNum, expected_seqNum );
166 static void my_cbk_onNVfound(eOethLowLevParser_packetInfo_t *pktInfo_ptr, eODeb_eoProtoParser_ropAdditionalInfo_t *ropAddInfo_ptr)
169 printf(
"NV found!!: ep=%x id=%x\n", ropAddInfo_ptr->desc.ep, ropAddInfo_ptr->desc.id);
175 printf(
"Invalid ropframe\n");
179 static void my_cbk_onNVsetpointFound(eOethLowLevParser_packetInfo_t *pktInfo_ptr, eODeb_eoProtoParser_ropAdditionalInfo_t *ropAddInfo_ptr)
181 eOmc_setpoint_t * setpoint_ptr = (eOmc_setpoint_t *)ropAddInfo_ptr->desc.data;
182 uint8_t
board = 0, j;
183 float enc_factor,
zero, enc_factor_6=182.044 , enc_factor_8=182.044, zero_6=180, zero_8=-180;
187 if(ropAddInfo_ptr->desc.ep == 0x18)
190 enc_factor = enc_factor_8;
193 else if(ropAddInfo_ptr->desc.ep == 0x16)
196 enc_factor = enc_factor_6;
201 printf(
"\n\n ERROR: un expected ep!!! %d \n ", ropAddInfo_ptr->desc.ep);
205 if(setpoint_ptr->type != eomc_setpoint_position)
207 printf(
"ERR: no setpoint position. typse= %d", setpoint_ptr->type);
211 switch(ropAddInfo_ptr->desc.id)
234 printf(
"ERROR: receiv unexpected nvid %x", ropAddInfo_ptr->desc.id);
240 pos = (setpoint_ptr->to.position.value/enc_factor)-
zero;
241 vel = setpoint_ptr->to.position.withvelocity/fabs(enc_factor);
243 printf(
"board %d j %d pos %f (%d) vel %f (%d) enc_factor=%f zero=%f\n",
board, j, pos, setpoint_ptr->to.position.value, vel, setpoint_ptr->to.position.withvelocity,enc_factor,
zero);
static void my_cbk_onNVsetpointFound(eOethLowLevParser_packetInfo_t *pktInfo_ptr, eODeb_eoProtoParser_ropAdditionalInfo_t *ropAddInfo_ptr)
static void my_cbk_onErrorSeqNum(eOethLowLevParser_packetInfo_t *pktInfo_ptr, uint32_t rec_seqNum, uint32_t expected_seqNum)
static void my_cbk_onNVfound(eOethLowLevParser_packetInfo_t *pktInfo_ptr, eODeb_eoProtoParser_ropAdditionalInfo_t *ropAddInfo_ptr)
const eODeb_eoProtoParser_cfg_t deb_eoParserCfg
static void my_cbk_onInvalidRopFrame(eOethLowLevParser_packetInfo_t *pktInfo_ptr)
const eODeb_eoProtoParser_cfg_t * deb_eoParserCfg_ptr