successful temperature reading
This commit is contained in:
@ -59,7 +59,7 @@ ReturnValue_t CspComIF::initializeInterface(CookieIF *cookie) {
|
||||
|
||||
uint8_t cspAddress = cspCookie->getCspAddress();
|
||||
uint16_t maxReplyLength = cspCookie->getMaxReplyLength();
|
||||
if(cspDeviceMap.find(cspAddress) != cspDeviceMap.end()){
|
||||
if(cspDeviceMap.find(cspAddress) == cspDeviceMap.end()){
|
||||
/* Insert device information in CSP map */
|
||||
cspDeviceMap.emplace(cspAddress, vectorBuffer(maxReplyLength));
|
||||
}
|
||||
@ -145,14 +145,19 @@ ReturnValue_t CspComIF::cspTransfer(uint8_t cspAddress, uint8_t cspPort,
|
||||
const uint8_t* cmdBuffer, int cmdBufferLen, uint16_t querySize) {
|
||||
|
||||
uint32_t timeout_ms = 1000;
|
||||
uint8_t* replyBuffer = cspDeviceMap[cspAddress].data();
|
||||
vectorBufferIter iter = cspDeviceMap.find(cspAddress);
|
||||
if(iter == cspDeviceMap.end()){
|
||||
sif::error << "CSP device with address " << cspAddress << " no found in"
|
||||
<< " device map" << std::endl;
|
||||
}
|
||||
uint8_t* replyBuffer = iter->second.data();
|
||||
uint8_t tmpCmdBuffer[cmdBufferLen];
|
||||
memcpy(tmpCmdBuffer, cmdBuffer, cmdBufferLen);
|
||||
|
||||
csp_conn_t * conn = csp_connect(CSP_PRIO_HIGH, cspAddress, cspPort, 0,
|
||||
CSP_O_NONE);
|
||||
|
||||
querySize = 12;
|
||||
querySize = 14;
|
||||
int receivedBytes = csp_transaction_persistent(conn, timeout_ms,
|
||||
tmpCmdBuffer, cmdBufferLen, replyBuffer, querySize);
|
||||
if(receivedBytes != querySize){
|
||||
|
Reference in New Issue
Block a user