Changeset 364 for asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/client.h
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/client.h
r337 r364 39 39 #define _CLIENT_H_ 40 40 41 #include <kernel.h> 42 #include "target_kernel_impl.h" 41 typedef struct client_info_t { 42 char client_id[80]; 43 char client_secret[32]; 44 } client_info_t; 43 45 44 #define CLIENT_PRIORITY 4 /* クライアントタスクの優先度 */ 46 typedef struct credential_t { 47 char device_code[100]; 48 char user_code[12]; 49 int expires_in; 50 int interval; 51 char verification_url[32]; 52 char access_token[132]; 53 char refresh_token[64]; 54 char scope[64]; 55 char token_type[16]; 56 } credential_t; 45 57 46 #define CLIENT_STACK_SIZE 6144 /* スタック領域のサイズ */ 58 typedef struct error_response_t { 59 char error[64]; 60 char error_description[64]; 61 } error_response_t; 47 62 48 extern void client_init(void); 49 extern void client_task(intptr_t exinf); 50 extern void client_fin(void); 63 typedef struct drive_file_t { 64 char kind[32]; 65 char id[36]; 66 char name[256]; 67 char mimeType[40]; 68 } drive_file_t; 69 70 typedef enum google_drive_parse_state_t { 71 psRoot, 72 psDeviceCode, 73 psUserCode, 74 psExpiresIn, 75 psInterval, 76 psVerificationUrl, 77 psAccessToken, 78 psRefreshToken, 79 psScope, 80 psTokenType, 81 psKind, 82 psId, 83 psName, 84 psMimeType, 85 psError, 86 psErrorDescription, 87 } google_drive_parse_state_t; 88 89 struct jsonsl_st; 90 typedef struct jsonsl_st *jsonsl_t; 91 92 typedef void (*parser_callback_t)(struct google_drive_t *gd, struct jsonsl_state_st *state, const char *buf); 93 94 typedef struct google_drive_t { 95 client_info_t client_info; 96 credential_t credential; 97 drive_file_t file; 98 error_response_t error; 99 jsonsl_t jsn; 100 google_drive_parse_state_t state; 101 char fname[sizeof("1:/log/20160101000000.log")]; 102 char jsn_buf[256]; 103 int jsn_buf_pos; 104 parser_callback_t start; 105 parser_callback_t end; 106 } google_drive_t; 107 108 extern google_drive_t google_drive; 109 110 void client_init(void); 111 void client_final(void); 112 113 void client_set_client_id(const char *client_id); 114 void client_set_client_secret(const char *client_secret); 115 int client_get_device_id(int argc, char **argv); 116 int client_get_access_token(int argc, char **argv); 117 int client_update_access_token(int argc, char **argv); 118 int client_revoke(int argc, char **argv); 119 int client_upload_file(int argc, char **argv); 51 120 52 121 #endif /* _CLIENT_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.