mm_utils.h 626 Bytes
Newer Older
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
30
31
32
33
34
#ifndef __MM_UTILS_H_
#define __MM_UTILS_H_

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include "mm_controller/mm_api.h"

typedef enum
{
    modem,
    beacon,
    hedgehog,
    unknown
} MMDeviceType;

void printBoolEnabled(char *prefix, bool v);

int boolAsInt(bool v);

void sleep_ms(int ms);
void trim(char *const a);

MMDeviceType getMMDeviceType(uint8_t deviceType);

void printMMDeviceVersionAndId(MarvelmindDeviceVersion *dv);
void printMMDeviceType(MMDeviceType *dt);

#ifndef WIN32
double getPassedTime(struct timespec *t1, struct timespec *t2);
#endif

#endif // __MM_UTILS_H_