syslog
This commit is contained in:
parent
8b37d39f14
commit
6b593988ec
@ -45,6 +45,7 @@ void debugTxCpltCallback(UART_HandleTypeDef *huart) {
|
|||||||
void syslog(char *msg) {
|
void syslog(char *msg) {
|
||||||
static uint8_t state = 0;
|
static uint8_t state = 0;
|
||||||
int8_t res8 = 0;
|
int8_t res8 = 0;
|
||||||
|
if (isNetworkAvailable()) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 0:
|
case 0:
|
||||||
res8 = socket(SYSLOG_SOCK, Sn_MR_UDP, 514, SF_IO_NONBLOCK);
|
res8 = socket(SYSLOG_SOCK, Sn_MR_UDP, 514, SF_IO_NONBLOCK);
|
||||||
@ -56,6 +57,7 @@ void syslog(char *msg) {
|
|||||||
sendto(SYSLOG_SOCK, (uint8_t*)msg, strlen(msg), syslogAddr, 514);
|
sendto(SYSLOG_SOCK, (uint8_t*)msg, strlen(msg), syslogAddr, 514);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flashGreenLed(void *handle) {
|
static void flashGreenLed(void *handle) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user