tcpTest started

This commit is contained in:
Wolfgang Hottgenroth 2020-11-11 14:19:02 +01:00
parent a8ded4a4f4
commit e306089188
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
5 changed files with 43 additions and 9 deletions

View File

@ -37,7 +37,7 @@ BUILD_DIR = build
###################################### ######################################
# C sources # C sources
C_SOURCES = \ C_SOURCES = \
User/Src/mqttComm.c User/Src/ports.c User/Src/eeprom.c User/Src/frontend.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c User/Src/show.c User/Src/utils.c User/Src/wizHelper.c hottislib/PontCoopScheduler.c \ User/Src/tcpTest.c User/Src/ports.c User/Src/eeprom.c User/Src/frontend.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c User/Src/show.c User/Src/utils.c User/Src/wizHelper.c hottislib/PontCoopScheduler.c \
libmbus/mbus/mbus-protocol.c \ libmbus/mbus/mbus-protocol.c \
Core/Src/main.c \ Core/Src/main.c \
Core/Src/gpio.c \ Core/Src/gpio.c \

9
cube/User/Inc/tcpTest.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef _TCPTEST_H_
#define _TCPTEST_H_
#include <stdint.h>
void tcpTestInit();
#endif /* _TCPTEST_H_ */

View File

@ -17,9 +17,7 @@
#include <frontend.h> #include <frontend.h>
#include <eeprom.h> #include <eeprom.h>
#include <wizHelper.h> #include <wizHelper.h>
#include <tcpTest.h>
#include <mqtt_interface.h>
#include <mqttComm.h>
void my_setup_1() { void my_setup_1() {
schInit(); schInit();
@ -193,7 +191,8 @@ void my_setup_2() {
wizInit(); wizInit();
mqttCommInit(NULL); tcpTestInit();
// frontendInit(); // frontendInit();
// frontendSetThreshold(240); // frontendSetThreshold(240);
@ -211,9 +210,6 @@ void my_loop() {
void SYSTICK_Callback() { void SYSTICK_Callback() {
// Pont Scheduler // Pont Scheduler
schUpdate(); schUpdate();
// MQTT Interface
MilliTimer_Handler();
} }
void HAL_GPIO_EXTI_Callback(uint16_t pin) { void HAL_GPIO_EXTI_Callback(uint16_t pin) {

View File

@ -6,3 +6,4 @@
const uint8_t DHCP_SOCK = 0; 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
View 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);
}
}