Skip to content

Instantly share code, notes, and snippets.

@gustavolaureano
Created August 16, 2018 13:03
Show Gist options
  • Save gustavolaureano/ddfed53d60e500e5454ad9bf6901e590 to your computer and use it in GitHub Desktop.
Save gustavolaureano/ddfed53d60e500e5454ad9bf6901e590 to your computer and use it in GitHub Desktop.
#pragma once
#include <zephyr/types.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <misc/printk.h>
#include <misc/byteorder.h>
#include <zephyr.h>
typedef struct Timer
{
uint64_t end_time;
} Timer;
typedef struct Network Network;
struct Network
{
uint32_t my_socket;
int (*mqttread) (Network*, unsigned char*, int, int);
int (*mqttwrite) (Network*, unsigned char*, int, int);
void (*disconnect) (Network*);
};
void TimerInit(Timer*);
char TimerIsExpired(Timer*);
void TimerCountdownMS(Timer*, unsigned int);
void TimerCountdown(Timer*, unsigned int);
int TimerLeftMS(Timer*);
int Zephyr_AT_read(Network*, unsigned char*, int, int);
int Zephyr_AT_write(Network*, unsigned char*, int, int);
void Zephyr_AT_disconnect(Network*);
void NetworkInit(Network*);
int NetworkConnect(Network*, char*, int);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment