Lines Matching refs:LSSslave

36     CO_LSSslave_t *LSSslave,  in CO_LSSslave_serviceSwitchStateGlobal()  argument
44 LSSslave->lssState = CO_LSS_STATE_WAITING; in CO_LSSslave_serviceSwitchStateGlobal()
45 CO_memset((uint8_t*)&LSSslave->lssSelect, 0, sizeof(LSSslave->lssSelect)); in CO_LSSslave_serviceSwitchStateGlobal()
48 LSSslave->lssState = CO_LSS_STATE_CONFIGURATION; in CO_LSSslave_serviceSwitchStateGlobal()
59 CO_LSSslave_t *LSSslave, in CO_LSSslave_serviceSwitchStateSelective() argument
66 if(LSSslave->lssState != CO_LSS_STATE_WAITING) { in CO_LSSslave_serviceSwitchStateSelective()
72 LSSslave->lssSelect.identity.vendorID = value; in CO_LSSslave_serviceSwitchStateSelective()
75 LSSslave->lssSelect.identity.productCode = value; in CO_LSSslave_serviceSwitchStateSelective()
78 LSSslave->lssSelect.identity.revisionNumber = value; in CO_LSSslave_serviceSwitchStateSelective()
81 LSSslave->lssSelect.identity.serialNumber = value; in CO_LSSslave_serviceSwitchStateSelective()
83 if (CO_LSS_ADDRESS_EQUAL(LSSslave->lssAddress, LSSslave->lssSelect)) { in CO_LSSslave_serviceSwitchStateSelective()
84 LSSslave->lssState = CO_LSS_STATE_CONFIGURATION; in CO_LSSslave_serviceSwitchStateSelective()
87 LSSslave->TXbuff->data[0] = CO_LSS_SWITCH_STATE_SEL; in CO_LSSslave_serviceSwitchStateSelective()
88 CO_memset(&LSSslave->TXbuff->data[1], 0, 7); in CO_LSSslave_serviceSwitchStateSelective()
89 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceSwitchStateSelective()
104 CO_LSSslave_t *LSSslave, in CO_LSSslave_serviceConfig() argument
113 if(LSSslave->lssState != CO_LSS_STATE_CONFIGURATION) { in CO_LSSslave_serviceConfig()
123 LSSslave->pendingNodeID = nid; in CO_LSSslave_serviceConfig()
130 LSSslave->TXbuff->data[0] = CO_LSS_CFG_NODE_ID; in CO_LSSslave_serviceConfig()
131 LSSslave->TXbuff->data[1] = errorCode; in CO_LSSslave_serviceConfig()
133 CO_memset(&LSSslave->TXbuff->data[2], 0, 6); in CO_LSSslave_serviceConfig()
134 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceConfig()
137 if (LSSslave->pFunctLSScheckBitRate == NULL) { in CO_LSSslave_serviceConfig()
148 bool_t bit_rate_supported = LSSslave->pFunctLSScheckBitRate( in CO_LSSslave_serviceConfig()
149 LSSslave->functLSScheckBitRateObject, bit); in CO_LSSslave_serviceConfig()
152 LSSslave->pendingBitRate = bit; in CO_LSSslave_serviceConfig()
164 LSSslave->TXbuff->data[0] = CO_LSS_CFG_BIT_TIMING; in CO_LSSslave_serviceConfig()
165 LSSslave->TXbuff->data[1] = errorCode; in CO_LSSslave_serviceConfig()
167 CO_memset(&LSSslave->TXbuff->data[2], 0, 6); in CO_LSSslave_serviceConfig()
168 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceConfig()
171 if (LSSslave->pFunctLSScheckBitRate == NULL) { in CO_LSSslave_serviceConfig()
177 if (LSSslave->pFunctLSSactivateBitRate != NULL) { in CO_LSSslave_serviceConfig()
180 LSSslave->pFunctLSSactivateBitRate( in CO_LSSslave_serviceConfig()
181 LSSslave->functLSSactivateBitRateObject, delay); in CO_LSSslave_serviceConfig()
187 if (LSSslave->pFunctLSScfgStore == NULL) { in CO_LSSslave_serviceConfig()
194 result = LSSslave->pFunctLSScfgStore(LSSslave->functLSScfgStore, in CO_LSSslave_serviceConfig()
195 LSSslave->pendingNodeID, LSSslave->pendingBitRate); in CO_LSSslave_serviceConfig()
202 LSSslave->TXbuff->data[0] = CO_LSS_CFG_STORE; in CO_LSSslave_serviceConfig()
203 LSSslave->TXbuff->data[1] = errorCode; in CO_LSSslave_serviceConfig()
205 CO_memset(&LSSslave->TXbuff->data[2], 0, 6); in CO_LSSslave_serviceConfig()
206 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceConfig()
217 CO_LSSslave_t *LSSslave, in CO_LSSslave_serviceInquire() argument
223 if(LSSslave->lssState != CO_LSS_STATE_CONFIGURATION) { in CO_LSSslave_serviceInquire()
229 value = LSSslave->lssAddress.identity.vendorID; in CO_LSSslave_serviceInquire()
232 value = LSSslave->lssAddress.identity.productCode; in CO_LSSslave_serviceInquire()
235 value = LSSslave->lssAddress.identity.revisionNumber; in CO_LSSslave_serviceInquire()
238 value = LSSslave->lssAddress.identity.serialNumber; in CO_LSSslave_serviceInquire()
241 value = (uint32_t)LSSslave->activeNodeID; in CO_LSSslave_serviceInquire()
247 LSSslave->TXbuff->data[0] = service; in CO_LSSslave_serviceInquire()
248 CO_memcpySwap4(&LSSslave->TXbuff->data[1], &value); in CO_LSSslave_serviceInquire()
249 CO_memset(&LSSslave->TXbuff->data[5], 0, 3); in CO_LSSslave_serviceInquire()
250 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceInquire()
257 CO_LSSslave_t *LSSslave, in CO_LSSslave_serviceIdent() argument
267 if (LSSslave->lssState != CO_LSS_STATE_WAITING) { in CO_LSSslave_serviceIdent()
275 if (LSSslave->pendingNodeID!=CO_LSS_NODE_ID_ASSIGNMENT || in CO_LSSslave_serviceIdent()
276 LSSslave->activeNodeID!=CO_LSS_NODE_ID_ASSIGNMENT) { in CO_LSSslave_serviceIdent()
297 LSSslave->fastscanPos = CO_LSS_FASTSCAN_VENDOR_ID; in CO_LSSslave_serviceIdent()
298 CO_memset((uint8_t*)&LSSslave->lssFastscan, 0, in CO_LSSslave_serviceIdent()
299 sizeof(LSSslave->lssFastscan)); in CO_LSSslave_serviceIdent()
301 else if (LSSslave->fastscanPos == lssSub) { in CO_LSSslave_serviceIdent()
304 if ((LSSslave->lssAddress.addr[lssSub] & mask) == (idNumber & mask)) { in CO_LSSslave_serviceIdent()
307 LSSslave->fastscanPos = lssNext; in CO_LSSslave_serviceIdent()
311 LSSslave->lssState = CO_LSS_STATE_CONFIGURATION; in CO_LSSslave_serviceIdent()
316 LSSslave->TXbuff->data[0] = CO_LSS_IDENT_SLAVE; in CO_LSSslave_serviceIdent()
317 CO_memset(&LSSslave->TXbuff->data[1], 0, 7); in CO_LSSslave_serviceIdent()
318 CO_CANsend(LSSslave->CANdevTx, LSSslave->TXbuff); in CO_LSSslave_serviceIdent()
332 CO_LSSslave_t *LSSslave; in CO_LSSslave_receive() local
334LSSslave = (CO_LSSslave_t*)object; /* this is the correct pointer type of the first argument */ in CO_LSSslave_receive()
340 CO_LSSslave_serviceSwitchStateGlobal(LSSslave, cs, msg); in CO_LSSslave_receive()
343 CO_LSSslave_serviceSwitchStateSelective(LSSslave, cs, msg); in CO_LSSslave_receive()
346 CO_LSSslave_serviceConfig(LSSslave, cs, msg); in CO_LSSslave_receive()
349 CO_LSSslave_serviceInquire(LSSslave, cs, msg); in CO_LSSslave_receive()
352 CO_LSSslave_serviceIdent(LSSslave, cs, msg); in CO_LSSslave_receive()
363 CO_LSSslave_t *LSSslave, in CO_LSSslave_init() argument
375 if (LSSslave==NULL || CANdevRx==NULL || CANdevTx==NULL || in CO_LSSslave_init()
386 CO_memcpy((uint8_t*)&LSSslave->lssAddress, (uint8_t*)&lssAddress, sizeof(LSSslave->lssAddress)); in CO_LSSslave_init()
387 LSSslave->lssState = CO_LSS_STATE_WAITING; in CO_LSSslave_init()
388 CO_memset((uint8_t*)&LSSslave->lssSelect, 0, sizeof(LSSslave->lssSelect)); in CO_LSSslave_init()
390 CO_memset((uint8_t*)&LSSslave->lssFastscan, 0, sizeof(LSSslave->lssFastscan)); in CO_LSSslave_init()
391 LSSslave->fastscanPos = CO_LSS_FASTSCAN_VENDOR_ID; in CO_LSSslave_init()
393 LSSslave->pendingBitRate = pendingBitRate; in CO_LSSslave_init()
394 LSSslave->pendingNodeID = pendingNodeID; in CO_LSSslave_init()
395 LSSslave->activeNodeID = CO_LSS_NODE_ID_ASSIGNMENT; in CO_LSSslave_init()
396 LSSslave->pFunctLSScheckBitRate = NULL; in CO_LSSslave_init()
397 LSSslave->functLSScheckBitRateObject = NULL; in CO_LSSslave_init()
398 LSSslave->pFunctLSSactivateBitRate = NULL; in CO_LSSslave_init()
399 LSSslave->functLSSactivateBitRateObject = NULL; in CO_LSSslave_init()
400 LSSslave->pFunctLSScfgStore = NULL; in CO_LSSslave_init()
401 LSSslave->functLSScfgStore = NULL; in CO_LSSslave_init()
410 (void*)LSSslave, /* object passed to receive function */ in CO_LSSslave_init()
414 LSSslave->CANdevTx = CANdevTx; in CO_LSSslave_init()
415 LSSslave->TXbuff = CO_CANtxBufferInit( in CO_LSSslave_init()
429 CO_LSSslave_t *LSSslave, in CO_LSSslave_initCheckBitRateCallback() argument
433 if(LSSslave != NULL){ in CO_LSSslave_initCheckBitRateCallback()
434 LSSslave->functLSScheckBitRateObject = object; in CO_LSSslave_initCheckBitRateCallback()
435 LSSslave->pFunctLSScheckBitRate = pFunctLSScheckBitRate; in CO_LSSslave_initCheckBitRateCallback()
442 CO_LSSslave_t *LSSslave, in CO_LSSslave_initActivateBitRateCallback() argument
446 if(LSSslave != NULL){ in CO_LSSslave_initActivateBitRateCallback()
447 LSSslave->functLSSactivateBitRateObject = object; in CO_LSSslave_initActivateBitRateCallback()
448 LSSslave->pFunctLSSactivateBitRate = pFunctLSSactivateBitRate; in CO_LSSslave_initActivateBitRateCallback()
455 CO_LSSslave_t *LSSslave, in CO_LSSslave_initCfgStoreCallback() argument
459 if(LSSslave != NULL){ in CO_LSSslave_initCfgStoreCallback()
460 LSSslave->functLSScfgStore = object; in CO_LSSslave_initCfgStoreCallback()
461 LSSslave->pFunctLSScfgStore = pFunctLSScfgStore; in CO_LSSslave_initCfgStoreCallback()
468 CO_LSSslave_t *LSSslave, in CO_LSSslave_process() argument
474 LSSslave->activeNodeID = activeNodeId; in CO_LSSslave_process()
475 *pendingBitRate = LSSslave->pendingBitRate; in CO_LSSslave_process()
476 *pendingNodeId = LSSslave->pendingNodeID; in CO_LSSslave_process()
482 CO_LSSslave_t *LSSslave) in CO_LSSslave_getState() argument
484 if(LSSslave != NULL){ in CO_LSSslave_getState()
485 return LSSslave->lssState; in CO_LSSslave_getState()
493 CO_LSSslave_t *LSSslave, in CO_LSSslave_LEDprocess() argument
500 if (LSSslave == NULL || LEDon == NULL) in CO_LSSslave_LEDprocess()
515 if (LSSslave->lssState == CO_LSS_STATE_CONFIGURATION) in CO_LSSslave_LEDprocess()
520 else if (LSSslave->activeNodeID == CO_LSS_NODE_ID_ASSIGNMENT) in CO_LSSslave_LEDprocess()