forked from grblHAL/Plugin_networking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
29 lines (23 loc) · 814 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// utils.h - Assorted utilities for networking plugin - some sourced from internet and possibly modified (public domain)
//
// Part of grblHAL
//
#ifndef __NETWORKING_UTILS_H__
#define __NETWORKING_UTILS_H__
#include <stdint.h>
#include <stdbool.h>
// WARNING: keep min sizes below relevant variable sizes defined in settings.h
#define SSID_LENGTH_MIN 1
#define SSID_LENGTH_MAX (sizeof(ssid_t) - 1)
#define HOSTNAME_LENGTH_MIN 1
#define HOSTNAME_LENGTH_MAX (sizeof(hostname_t) - 1)
#define PASSWORD_LENGTH_MIN 8
#define PASSWORD_LENGTH_MAX (sizeof(password_t) - 1)
#define HIDDEN_PASSWORD "********"
char *btoa (uint64_t bytes);
bool is_valid_port (uint16_t port);
bool is_valid_hostname (const char *hostname);
bool is_valid_ssid (const char *ssid);
bool is_valid_password (const char *password);
#endif