13#include "tuya_cloud_types.h"
19#define BITMASK(bit) (1 << (bit))
21#define GETBIT(val,bit) (((val) & BITMASK(bit)) > 0)
23#define SETBIT(val,bit) ((val) |= BITMASK(bit))
25#define RESETBIT(val,bit) ((val) &= ~BITMASK(bit))
53void ascs2hex(
unsigned char *hex,
unsigned char *ascs,
int srclen);
64void hex2str(
unsigned char *pbDest,
unsigned char *pbSrc,
int nLen);
65void byte2str(
unsigned char *pbDest,
unsigned char *pbSrc,
int nLen, bool_t upper);
84void byte_sort(
unsigned char is_ascend,
unsigned char *buf,
int buf_cnt);
124int tuya_isalpha(
int c);
125int tuya_tolower(
int c);
126int tuya_toupper(
int c);
int string2mac(const char *str, char mac[6])
convert mac address string to mac address array
void hex2str(unsigned char *pbDest, unsigned char *pbSrc, int nLen)
convert the input hex array to string array
int tuya_strncasecmp(const char *s1, const char *s2, size_t n)
compare the first n characters of two string
char * mm_strdup(const char *str)
duplicate input string, will malloc a new block of memory
int str_revr_find_ch(const char *str, const int revr_index, const char ch)
find <ch> in <str>, start find in index <revr_index>, find in reverse order.
int versionString2int(const char *versionString)
convert version string to integer
void ascs2hex(unsigned char *hex, unsigned char *ascs, int srclen)
convert the character array to hex array
unsigned char asc2hex(char asccode)
convert character to hex, if '0'-'f'/'F' -> 0-15, else 0
int is_valid_version(char *ver)
check the version input is valid
void byte_sort(unsigned char is_ascend, unsigned char *buf, int buf_cnt)
sort the char in the buf according ascii value