generated from grisuno/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbeacon.h
More file actions
30 lines (25 loc) · 791 Bytes
/
beacon.h
File metadata and controls
30 lines (25 loc) · 791 Bytes
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
// beacon_api.h
#ifndef BEACON_API_H
#define BEACON_API_H
#include <stdint.h>
#include <stdarg.h>
// Tipos de callback
#define CALLBACK_OUTPUT 0x00
#define CALLBACK_ERROR 0x0D
#define CALLBACK_OUTPUT_OEM 0x0E
// Estructura para parsing de datos (opcional, para comandos complejos)
typedef struct {
char *original;
char *buffer;
int length;
} datap;
// === API para BOFs ===
void BeaconDataParse(datap *parser, char *buffer, int size);
char *BeaconDataPtr(datap *parser, int size);
int BeaconDataInt(datap *parser);
short BeaconDataShort(datap *parser);
int BeaconDataLength(datap *parser);
char *BeaconDataExtract(datap *parser, int *size);
void BeaconPrintf(int type, const char *fmt, ...);
void BeaconOutput(int type, const char *data, int len);
#endif // BEACON_API_H