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_nv_identify_t),
111 EO_INIT(.cbk_onNVfound) NULL
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 from 0x%x; rec=%d expected=%d\n", pktInfo_ptr->src_addr, 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!!: id=%x\n", ropAddInfo_ptr->desc.id32);
175 printf(
"Invalid ropframe rec from 0x%x\n", pktInfo_ptr->src_addr);
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;
190 pos = (setpoint_ptr->to.position.value/enc_factor)-
zero;
191 vel = setpoint_ptr->to.position.withvelocity/fabs(enc_factor);
193 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