blob: 8a9e53e403d5a17ee65cfd4acd0f015f3456f450 (
plain)
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
|
#pragma once
#include <string.h>
#include "api.h"
struct SizedBlock {
char *memory;
size_t size;
};
enum HttpMethod {
HTTP_GET,
HTTP_POST,
};
enum TokenType {
TOKEN_NONE,
TOKEN_DEVICE,
TOKEN_USER,
};
#define MAX_URL_BUFLEN 512
#define NEW_DEVICE_TOKEN_URL "https://webapp-prod.cloud.remarkable.engineering/token/json/2/device/new"
#define NEW_USER_TOKEN_URL "https://webapp-prod.cloud.remarkable.engineering/token/json/2/user/new"
#define GET_ROOT_URL "https://internal.cloud.remarkable.com/sync/v4/root"
#define GET_BLOB_URL "https://internal.cloud.remarkable.com/sync/v3/files/%.*s"
enum ReturnCode client_send(struct RMDevice *dev, char *url, enum HttpMethod method, enum TokenType token, char *filename, char *reqBody, struct SizedBlock *retBody);
|