alan broad
/
carbon_v5_arm_studio
arm studio build
Diff: src/main.cpp
- Revision:
- 2:0af50f386eb2
- Parent:
- 1:0d25d9ddbe9f
- Child:
- 5:abfe25f0de33
--- a/src/main.cpp Sat Aug 04 19:25:02 2018 +0000 +++ b/src/main.cpp Sat Aug 04 19:56:33 2018 +0000 @@ -420,35 +420,35 @@ pDwnRadio->cmd = XDOT_CMD_SET_RADIO; if (pUpRadio->bSetParams){ - pc.printf("\n\r setting subband to %d ",pUpRadio->sub_band); - cfg_network(false,true,(uint8_t)pUpRadio->sub_band); - pc.printf("\n\r setting adr to %d ",pUpRadio->aDR); - dot->setAdr((uint8_t)pUpRadio->aDR); // enable or disable Adaptive Data Rate - pc.printf("\n\r setting antenna gain to %d ",pUpRadio->antennaGaindBi); - dot->setAntennaGain(pUpRadio->antennaGaindBi); - pc.printf("\n\r setting radio tx power to %d ",pUpRadio->txPowerdBm); - dot->setTxPower(pUpRadio->txPowerdBm); - pc.printf("\n\r setting tx datarate to %d ",pUpRadio->dataRate); - dot->setTxDataRate(pUpRadio->dataRate); + pc.printf("\n\r setting subband to %d ",pUpRadio->params.sub_band); + cfg_network(false,true,(uint8_t)pUpRadio->params.sub_band); + pc.printf("\n\r setting adr to %d ",pUpRadio->params.aDR); + dot->setAdr((uint8_t)pUpRadio->params.aDR); // enable or disable Adaptive Data Rate + pc.printf("\n\r setting antenna gain to %d ",pUpRadio->params.antennaGaindBi); + dot->setAntennaGain(pUpRadio->params.antennaGaindBi); + pc.printf("\n\r setting radio tx power to %d ",pUpRadio->params.txPowerdBm); + dot->setTxPower(pUpRadio->params.txPowerdBm); + pc.printf("\n\r setting tx datarate to %d ",pUpRadio->params.dataRate); + dot->setTxDataRate(pUpRadio->params.dataRate); // pc.printf("\n\r setting application port %d ",pUpRadio->appPort); // dot->setAppPort(pUpRadio->appPort); - pc.printf("\n\r setting link check threshold %d ",pUpRadio->linkChkCount); - dot->setLinkCheckThreshold(pUpRadio->linkChkCount); + pc.printf("\n\r setting link check threshold %d ",pUpRadio->params.linkChkCount); + dot->setLinkCheckThreshold(pUpRadio->params.linkChkCount); pc.printf("\n\r saving configuration"); if (!dot->saveConfig())logError("failed to save configuration"); display_config(); } - pDwnRadio->public_network = public_network; - pDwnRadio->sub_band = dot->getFrequencySubBand(); - pDwnRadio->linkChkCount = dot->getLinkCheckThreshold(); - pDwnRadio->maxDataLen = dot->getMaxPacketLength(); - pDwnRadio->maxTxPowerdBm = dot->getMaxTxPower(); - pDwnRadio->minTxPowerdBm = dot->getMinTxPower(); - pDwnRadio->aDR = dot->getAdr(); - pDwnRadio->antennaGaindBi = dot->getAntennaGain(); - pDwnRadio->txPowerdBm = dot->getTxPower(); - pDwnRadio->dataRate = dot->getTxDataRate(); + pDwnRadio->params.public_network = public_network; + pDwnRadio->params.sub_band = dot->getFrequencySubBand(); + pDwnRadio->params.linkChkCount = dot->getLinkCheckThreshold(); + pDwnRadio->params.maxDataLen = dot->getMaxPacketLength(); + pDwnRadio->params.maxTxPowerdBm = dot->getMaxTxPower(); + pDwnRadio->params.minTxPowerdBm = dot->getMinTxPower(); + pDwnRadio->params.aDR = dot->getAdr(); + pDwnRadio->params.antennaGaindBi = dot->getAntennaGain(); + pDwnRadio->params.txPowerdBm = dot->getTxPower(); + pDwnRadio->params.dataRate = dot->getTxDataRate(); // pDwnRadio->appPort = dot->getAppPort(); break; case XDOT_CMD_GET_EUI: //0307: modified to include radio parameter settings @@ -481,7 +481,12 @@ pktwrk->bSetNetwrk = (uint8_t)bWriteSession; break; case XDOT_CMD_SET_NVM: - + pkt_setnvmdwn *pDwnNvm= (pkt_setnvmdwn*)&buf_xmt[0]; + pkt_setnvmup *pUpNvm = (pkt_setnvmup*)&buf_rcv[0]; + pDwnNvm->ack = I2C_ACK_PROC; + pDwnNvm->cmd = XDOT_CMD_SET_RADIO; + nvmWrite(&pUpNvm->nvmData); + nvmRead(&pDwnNvm->nvmData); break; case XDOT_CMD_SET_KEY_X: pc.printf("\n\r proc cmd: set a key, simulating minm delay before wake pulse\r\n");