![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
I added functionality to get the RSSI, BER, and Cell Neighbor for reporting connection issues to M2X
Dependencies: mbed FXOS8700CQ mbed-rtos WNCInterface M2XStreamClient-JMF jsonlite
Diff: sensors.cpp
- Revision:
- 12:0dfd0129f75d
- Parent:
- 5:8099493f2c35
diff -r 62e995e72c3b -r 0dfd0129f75d sensors.cpp --- a/sensors.cpp Thu Oct 26 04:29:26 2017 +0000 +++ b/sensors.cpp Thu Apr 18 21:30:09 2019 +0000 @@ -19,6 +19,7 @@ #include "sensors.h" #include "FXOS8700CQ.h" #include "HTS221.h" +#include "WNCInterface.h" #include <string> //I2C for pmod sensors: @@ -419,7 +420,20 @@ } //bHTS221_present } //Read_HTS221() - +void Read_connection() // This function polls the K64F for signal strength in DBs(RSSI), Bit Error Rate, and gets the Neighboring Cell Tower's ID +{ + using namespace WncControllerK64F_fk; + WNCInterface eth; + int16_t fRssi; + fRssi = eth.getRSSI(); + SENSOR_DATA.Signal_Strength = fRssi; + int16_t fBer; + fBer = eth.get3gBer(); + SENSOR_DATA.Error = fBer; + string * fN; + fN = eth.readCellNeighbor_wnc(); + SENSOR_DATA.Neighbor = fN; + } void sensors_init(void) { Init_HTS221(); @@ -434,4 +448,6 @@ Read_Si7020(); Read_Si1145(); Read_motion_sensor(); + Read_connection(); } //read_sensors +