fixed some bugs

master
Ondřej Hruška 7 years ago
parent 93ed9b7a94
commit 63dd4aa757
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 4
      CMakeLists.txt
  2. 5
      gex/TF_Integration.c
  3. 2
      gex/gex_client.c
  4. 6
      gex/gex_client.h
  5. 16
      gex/gex_defines.h
  6. 4
      gex/gex_helpers.c
  7. 4
      gex/gex_helpers.h
  8. 4
      gex/gex_internal.h

@ -11,7 +11,7 @@ set(SOURCE_FILES
gex/gex_client.h gex/gex_client.h
gex/gex_helpers.c gex/gex_helpers.c
gex/gex_helpers.h gex/gex_helpers.h
gex/gex_client_internal.h gex/gex_internal.h
gex/gex_message_types.h gex/gex_message_types.h
gex/utils/hexdump.c gex/utils/hexdump.c
gex/utils/hexdump.h gex/utils/hexdump.h
@ -24,7 +24,7 @@ set(SOURCE_FILES
gex/protocol/TinyFrame.c gex/protocol/TinyFrame.c
gex/protocol/TinyFrame.h gex/protocol/TinyFrame.h
gex/utils/type_coerce.h gex/utils/type_coerce.h
) gex/gex_defines.h)
include_directories( include_directories(
gex gex

@ -1,12 +1,11 @@
#include "TinyFrame.h"
#include "gex_client.h"
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include "gex_client_internal.h" #include "TinyFrame.h"
#include "gex_internal.h"
void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len) void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len)
{ {

@ -12,7 +12,7 @@
#include "gex_client.h" #include "gex_client.h"
#include "serial.h" #include "serial.h"
#include "gex_client_internal.h" #include "gex_internal.h"
#include "gex_message_types.h" #include "gex_message_types.h"
#include "gex_helpers.h" #include "gex_helpers.h"
#include "utils/payload_parser.h" #include "utils/payload_parser.h"

@ -9,11 +9,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "TinyFrame.h" #include "TinyFrame.h"
#include "gex_defines.h"
typedef struct gex_client_ GexClient;
/** Callback for spontaneous reports from units */
typedef void (*GEX_ReportListener)(GexClient *gex, const char *unit, uint8_t code, const uint8_t *payload, uint32_t len);
/** /**
* Bind a report listener * Bind a report listener

@ -0,0 +1,16 @@
//
// Created by MightyPork on 2017/12/19.
//
#ifndef GEX_CLIENT_GEX_DEFINES_H
#define GEX_CLIENT_GEX_DEFINES_H
#include <stdint.h>
#include <stdbool.h>
typedef struct gex_client_ GexClient;
/** Callback for spontaneous reports from units */
typedef void (*GEX_ReportListener)(GexClient *gex, const char *unit, uint8_t code, const uint8_t *payload, uint32_t len);
#endif //GEX_CLIENT_GEX_DEFINES_H

@ -2,8 +2,10 @@
// Created by MightyPork on 2017/12/19. // Created by MightyPork on 2017/12/19.
// //
#include <malloc.h>
#include "gex_defines.h"
#include "gex_helpers.h" #include "gex_helpers.h"
#include "gex_client_internal.h"
/** Delete recursively all GEX callsign look-up table entries */ /** Delete recursively all GEX callsign look-up table entries */
void destroy_unit_lookup(GexClient *gex) void destroy_unit_lookup(GexClient *gex)

@ -5,8 +5,8 @@
#ifndef GEX_CLIENT_GEX_HELPERS_H #ifndef GEX_CLIENT_GEX_HELPERS_H
#define GEX_CLIENT_GEX_HELPERS_H #define GEX_CLIENT_GEX_HELPERS_H
#include "gex_client_internal.h" #include "gex_internal.h"
#include "gex_client.h" #include "gex_defines.h"
/** Delete recursively all GEX callsign look-up table entries */ /** Delete recursively all GEX callsign look-up table entries */
void destroy_unit_lookup(GexClient *gex); void destroy_unit_lookup(GexClient *gex);

@ -5,6 +5,10 @@
#ifndef GEX_CLIENT_GEX_CLIENT_INTERNAL_H #ifndef GEX_CLIENT_GEX_CLIENT_INTERNAL_H
#define GEX_CLIENT_GEX_CLIENT_INTERNAL_H #define GEX_CLIENT_GEX_CLIENT_INTERNAL_H
#include <stdint.h>
#include <stdbool.h>
#include "gex_client.h"
struct gex_unit_lu { struct gex_unit_lu {
char *name; //!< Unit name char *name; //!< Unit name
char *type; //!< Unit type char *type; //!< Unit type
Loading…
Cancel
Save