add mic-e 1

This commit is contained in:
richonguzman 2023-12-17 10:53:04 -03:00
parent 69cbeac09e
commit 9652882be8
4 changed files with 10 additions and 11 deletions

View File

@ -191,7 +191,7 @@ namespace APRSPacketLib {
return miceLongitudeStruct;
}
String generateMiceGPSBeacon(String miceMsgType, String callsign, String symbol, String overlay, float latitude, float longitude, float course, float speed, int altitude, String comment) {
String generateMiceGPSBeacon(String miceMsgType, String callsign, String symbol, String overlay, float latitude, float longitude, float course, float speed, int altitude) {
gpsLatitudeStruct latitudeStruct = gpsDecimalToDegreesMiceLatitude(latitude);
gpsLongitudeStruct longitudeStruct = gpsDecimalToDegreesMiceLongitude(longitude);
@ -200,7 +200,7 @@ namespace APRSPacketLib {
miceDestinationArray[6] = 0x00; // por repetidor?
String miceDestination = (char*)miceDestinationArray;
uint8_t miceInfoFieldArray[15];
uint8_t miceInfoFieldArray[14];
miceInfoFieldArray[0] = 0x60; // 0x60 for ` and 0x27 for '
miceLongitudeEncoding(&miceInfoFieldArray[1], &longitudeStruct);
miceCourseSpeedEncoding(&miceInfoFieldArray[4], (uint32_t)speed, (uint32_t)course); //speed= gps.speed.knots(), course = gps.course.deg());
@ -211,12 +211,11 @@ namespace APRSPacketLib {
strncpy(symbolOverlayArray,overlay.c_str(),1);
miceInfoFieldArray[8] = symbolOverlayArray[0];
miceInfoFieldArray[9] = 0x60;
miceAltiduteEncoding(&miceInfoFieldArray[10], (uint32_t)altitude); // altitude = gps.altitude.meters()
miceInfoFieldArray[14] = 0x00; // por repetidor?
miceAltiduteEncoding(&miceInfoFieldArray[9], (uint32_t)altitude); // altitude = gps.altitude.meters()
miceInfoFieldArray[13] = 0x00; // por repetidor?
String miceInformationField = (char*)miceInfoFieldArray;
return callsign + ">" + miceDestination + ":" + miceInformationField + comment;
return callsign + ">" + miceDestination + ":" + miceInformationField;
}
String generateBasePacket(String callsign, String tocall, String path) {

View File

@ -47,7 +47,7 @@ namespace APRSPacketLib {
gpsLatitudeStruct gpsDecimalToDegreesMiceLatitude(float latitude);
gpsLongitudeStruct gpsDecimalToDegreesMiceLongitude(float longitude);
String generateMiceGPSBeacon(String miceMsgType, String callsign, String symbol, String overlay, float latitude, float longitude, float course, float speed, int altitude, String comment);
String generateMiceGPSBeacon(String miceMsgType, String callsign, String symbol, String overlay, float latitude, float longitude, float course, float speed, int altitude);
String generateBasePacket(String callsign, String tocall, String path);
String generateStatusPacket(String callsign, String tocall, String path, String status);

View File

@ -87,7 +87,7 @@ namespace BLE_Utils {
return;
}
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BLE Tx", "---> %s", BLEToLoRaPacket.c_str());
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BLE Tx", "%s", BLEToLoRaPacket.c_str());
show_display("BLE Tx >>", "", BLEToLoRaPacket, 1000);
LoRa_Utils::sendNewPacket(BLEToLoRaPacket);
@ -121,7 +121,7 @@ namespace BLE_Utils {
void sendToPhone(const String& packet) {
if (!packet.isEmpty()) {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BLE Rx", "---> %s", packet.c_str());
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BLE Rx", "%s", packet.c_str());
String receivedPacketString = "";
for (int i=0; i<packet.length();i++) {
receivedPacketString += packet[i];

View File

@ -394,8 +394,8 @@ namespace STATION_Utils {
} else {
//packet = APRSPacketLib::generateGPSBeaconPacket(currentBeacon->callsign, "APLRT1", Config.path, currentBeacon->overlay, APRSPacketLib::encondeGPS(gps.location.lat(),gps.location.lng(), gps.course.deg(), gps.speed.knots(), currentBeacon->symbol, Config.sendAltitude, gps.altitude.feet(), sendStandingUpdate, "GPS"));
//
//packet = APRSPacketLib::generateMiceGPSBeacon("110", currentBeacon->callsign, currentBeacon->symbol, currentBeacon->overlay, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters(), currentBeacon->comment);
packet = APRSPacketLib::generateMiceGPSBeacon("110", currentBeacon->callsign, currentBeacon->symbol, currentBeacon->overlay, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters(), "test Mic-E");
// this is Mic-E Test
packet = APRSPacketLib::generateMiceGPSBeacon("110", currentBeacon->callsign, currentBeacon->symbol, currentBeacon->overlay, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters());
//
}
if (currentBeacon->comment != "") {