Newer
Older
Tardis / third_party / sntp / sntp.h
@Jookia Jookia on 4 Apr 2023 572 bytes sntp: clang-format
/*- Project:    A simple SNTP client
  - Author:     Richard James Howe
  - License:    The Unlicense
  - Email:      howe.r.j.89@gmail.com
  - Repository: https://github.com/howerj/sntp
  - mbed port (c) 2023 John Watts and Casey Reeves */
#ifndef SNTP_H
#define SNTP_H

#include "NetworkInterface.h"
#include <time.h>

enum SNTPError {
	SNTPSuccess = 0,
	SNTPDnsError = 1,
	SNTPConnectError = 2,
	SNTPOpenError = 3,
	SNTPSendError = 4,
	SNTPReceiveError = 5,
};

SNTPError sntp(NetworkInterface &net, const char *server, unsigned int port,
	struct timeval *tv);

#endif