Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DmTftLibrary eeprom SX1280Lib filesystem mbed
Fork of MSNV2-Terminal_V1-5 by
DataBase.cpp
- Committer:
- patrick_duc
- Date:
- 2018-08-27
- Revision:
- 13:5414193da1de
- Parent:
- 10:1b37e3b41947
- Child:
- 18:d5e7e56b0a0d
File content as of revision 13:5414193da1de:
/* * MISNet * * Frame: Gestionnaire de fabrication des messages et décodage des messages recus * * Created on: August 17, 2018 Author: Francis CHATAIN * */ // ===================================== Includes //#include "main.h" #include "DataBase.h" // ===================================== Method of class // ===================================== Constructor DataBase::DataBase () {} DataBase::~DataBase () {} void DataBase::init () {} void DataBase::getRadioParameter (uint32_t &rfFrequency, RadioLoRaBandwidths_t &loraBw, RadioLoRaSpreadingFactors_t &loraSf , int8_t &txOutputPower, uint8_t &bufferSizeMax, int16_t &timer) { rfFrequency = _RF_FREQUENCY ; loraBw = _LORA_BW ; loraSf = _LORA_SF ; txOutputPower = _TX_OUTPUT_POWER ; bufferSizeMax = _BUFFER_SIZE_MAX ; timer = _TIMER ; } void DataBase::setRadioParameter ( uint32_t rfFrequency, RadioLoRaBandwidths_t loraBw, RadioLoRaSpreadingFactors_t loraSf , int8_t txOutputPower, uint8_t bufferSizeMax, int16_t timer) { _RF_FREQUENCY = rfFrequency ; _LORA_BW = loraBw ; _LORA_SF = loraSf ; _TX_OUTPUT_POWER = txOutputPower ; _BUFFER_SIZE_MAX = bufferSizeMax ; _TIMER = timer ; printf( "*** DTB *** setRadioParameter %ld %d %d %d %d %d \r\n",_RF_FREQUENCY, _LORA_BW, _LORA_SF, _TX_OUTPUT_POWER, _BUFFER_SIZE_MAX,_TIMER ); } short DataBase::getNbChannel(Channel::DEVICE_TYPE deviceType) { short result = 0; std::vector<Channel*> channels = this->_payload->getChannels(); for(std::vector<Channel*>::iterator it = channels.begin(); it != channels.end(); it++) { Channel* channel = *it; if (channel->getDeviceType() == deviceType) { result++; } } return result; } Channel::DEVICE_TYPE DataBase::getChannelType (short channelRank) { return Channel::SENSOR; //return this->payload.getChannel(channelRank).getDeviceType(); } /* Channel& DataBase::createChannel ( int id , CHANNEL_DEVICE_TYPE typeDevice, CHANNEL_COMPONENT_ID componentID, CHANNEL_GROUP group, CHANNEL_VALUE_TYPE typeValue, CHANNEL_STATE status, CHANNEL_ACCESS_TYPE accessType, CHANNEL_ACCES_PIN pin1, CHANNEL_ACCES_PIN pin2, CHANNEL_ACCES_PIN pin3, CHANNEL_ACCES_PIN pin4, CHANNEL_ACCES_PIN pin5, CHANNEL_ACCES_PIN pin6, CHANNEL_REQUEST_MODE request, CHANNEL_UP_MODE upMode, CHANNEL_TIMER_DIVIDE timerRequest, CHANNEL_THRESHOLD_DELTA thresholdDelta, CHANNEL_THRESHOLD_UP thresholdUp, CHANNEL_THRESHOLD_DOWN thresholdDown, CHANNEL_ACTION action, CHANNEL_OUTPUT ouputType ) { Channel channel = new Channel(); } */