29 lines
718 B
C
29 lines
718 B
C
//
|
|
// Created by cfif on 05.07.23.
|
|
//
|
|
|
|
#include "GsmWithGnss.h"
|
|
#include "memory.h"
|
|
#include "ext_telematica.h"
|
|
|
|
void GsmSocketSlot_Init(tGsmSocketSlot *slot, uint32_t bufLen) {
|
|
memset(slot, 0, sizeof(tGsmSocketSlot));
|
|
slot->rxDataQueue = osMessageQueueNew(bufLen, 1, NULL);
|
|
asm("nop");
|
|
}
|
|
|
|
void GsmSocketSlot_Set(tGsmSocketSlot *slot, eSocketType type, char *addr, size_t addrSize, uint16_t port) {
|
|
String32Copy(&slot->addr, addr, addrSize);
|
|
slot->port = port;
|
|
slot->type = type;
|
|
}
|
|
|
|
void GsmSocketSlot_Clear(tGsmSocketSlot *slot) {
|
|
osMessageQueueReset(slot->rxDataQueue);
|
|
slot->addr.length = 0;
|
|
}
|
|
|
|
bool GsmSocketSlot_IsClear(tGsmSocketSlot *slot) {
|
|
return slot->addr.length == 0;
|
|
}
|