tcpTest started
This commit is contained in:
@ -17,9 +17,7 @@
|
||||
#include <frontend.h>
|
||||
#include <eeprom.h>
|
||||
#include <wizHelper.h>
|
||||
|
||||
#include <mqtt_interface.h>
|
||||
#include <mqttComm.h>
|
||||
#include <tcpTest.h>
|
||||
|
||||
void my_setup_1() {
|
||||
schInit();
|
||||
@ -193,7 +191,8 @@ void my_setup_2() {
|
||||
|
||||
wizInit();
|
||||
|
||||
mqttCommInit(NULL);
|
||||
tcpTestInit();
|
||||
|
||||
|
||||
// frontendInit();
|
||||
// frontendSetThreshold(240);
|
||||
@ -211,9 +210,6 @@ void my_loop() {
|
||||
void SYSTICK_Callback() {
|
||||
// Pont Scheduler
|
||||
schUpdate();
|
||||
|
||||
// MQTT Interface
|
||||
MilliTimer_Handler();
|
||||
}
|
||||
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t pin) {
|
||||
|
@ -5,4 +5,5 @@
|
||||
// on the W5500 there are eight ports available
|
||||
|
||||
const uint8_t DHCP_SOCK = 0;
|
||||
const uint8_t MQTT_SOCK = 1;
|
||||
const uint8_t MQTT_SOCK = 1;
|
||||
const uint8_t TCPTEST_SOCK = 2;
|
28
cube/User/Src/tcpTest.c
Normal file
28
cube/User/Src/tcpTest.c
Normal file
@ -0,0 +1,28 @@
|
||||
#include <tcpTest.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <socket.h>
|
||||
|
||||
#include <logger.h>
|
||||
#include <PontCoopScheduler.h>
|
||||
|
||||
|
||||
const uint8_t TCPTEST_SOCK;
|
||||
|
||||
|
||||
void tcpTestHandler(void *handle) {
|
||||
coloredMsg(LOG_YELLOW, "tth");
|
||||
}
|
||||
|
||||
void tcpTestInit() {
|
||||
int8_t res = socket(TCPTEST_SOCK, Sn_MR_TCP, 12345, SF_IO_NONBLOCK);
|
||||
coloredMsg(LOG_RED, "tti, socket returns %d", res);
|
||||
|
||||
if (res == TCPTEST_SOCK) {
|
||||
schAdd(tcpTestHandler, NULL, 0, 100);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user