Add skeleton of FollowSun.* RPCs

This commit is contained in:
Pim van Pelt
2019-10-03 21:56:54 +02:00
parent 94e3b20548
commit 3ea9a16adb

View File

@ -287,6 +287,46 @@ exit:
(void)fi;
}
static void rpc_followsun_get_handler(struct mg_rpc_request_info *ri, void *cb_arg, struct mg_rpc_frame_info *fi, struct mg_str args) {
rpc_log(ri, args);
mg_rpc_send_errorf(ri, 400, "Not implemented yet");
ri = NULL;
return;
(void)cb_arg;
(void)fi;
}
static void rpc_followsun_set_handler(struct mg_rpc_request_info *ri, void *cb_arg, struct mg_rpc_frame_info *fi, struct mg_str args) {
rpc_log(ri, args);
mg_rpc_send_errorf(ri, 400, "Not implemented yet");
ri = NULL;
return;
(void)cb_arg;
(void)fi;
}
static void rpc_followsun_clear_handler(struct mg_rpc_request_info *ri, void *cb_arg, struct mg_rpc_frame_info *fi, struct mg_str args) {
rpc_log(ri, args);
mg_rpc_send_errorf(ri, 400, "Not implemented yet");
ri = NULL;
return;
(void)cb_arg;
(void)fi;
}
static void rpc_followsun_replace_handler(struct mg_rpc_request_info *ri, void *cb_arg, struct mg_rpc_frame_info *fi, struct mg_str args) {
rpc_log(ri, args);
mg_rpc_send_errorf(ri, 400, "Not implemented yet");
ri = NULL;
return;
(void)cb_arg;
(void)fi;
}
void rpc_init() {
struct mg_rpc *c = mgos_rpc_get_global();
@ -297,4 +337,8 @@ void rpc_init() {
mg_rpc_add_handler(c, "Timespec.Clear", "{idx: %d}", rpc_timespec_clear_handler, NULL);
mg_rpc_add_handler(c, "Timespec.Add", "{idx: %d, spec: %Q}", rpc_timespec_add_handler, NULL);
mg_rpc_add_handler(c, "Timespec.Replace", "{idx: %d, spec: %Q}", rpc_timespec_replace_handler, NULL);
mg_rpc_add_handler(c, "FollowSun.Get", "{idx: %d}", rpc_followsun_get_handler, NULL);
mg_rpc_add_handler(c, "FollowSun.Clear", "{idx: %d}", rpc_followsun_clear_handler, NULL);
mg_rpc_add_handler(c, "FollowSun.Set", "{idx: %d, riseoffset: %d, setoffset: %d}", rpc_followsun_set_handler, NULL);
mg_rpc_add_handler(c, "FollowSun.Replace", "{idx: %d, riseoffset: %d, setoffset: %d}", rpc_followsun_replace_handler, NULL);
}