尝试增加rpc
This commit is contained in:
@@ -8,6 +8,7 @@ static MKFS_PARM defopt = {FM_ANY, 0, 0, 0};
|
||||
int main(int args, char *argv[])
|
||||
{
|
||||
FRESULT res = f_mount(&fs, "0:", 1);
|
||||
|
||||
if (res != FR_OK)
|
||||
{
|
||||
res = f_mkfs("0:", &defopt, buff, 512); // 第三个参数可以设置成NULL,默认使用heap memory
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "u_hd_man.h"
|
||||
#include "u_ns.h"
|
||||
#include "test.h"
|
||||
#include "u_rpc.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
@@ -53,6 +54,7 @@ int main(int argc, char *args[])
|
||||
malloc_test();
|
||||
irq_test();
|
||||
#endif
|
||||
rpc_test();
|
||||
ns_test();
|
||||
task_unmap(TASK_THIS, vpage_create_raw3(KOBJ_DELETE_RIGHT, 0, TASK_THIS));
|
||||
ulog_write_str(u_get_global_env()->log_hd, "Error.\n");
|
||||
|
||||
23
mkrtos_user/server/shell/src/rpc_test.c
Normal file
23
mkrtos_user/server/shell/src/rpc_test.c
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
#include "u_rpc.h"
|
||||
typedef struct test_svr
|
||||
{
|
||||
|
||||
} test_svr_t;
|
||||
|
||||
RPC_GENERATION_CALL1(test_svr_t, 0, register, rpc_int_t, RPC_DIR_IN, RPC_TYPE_BUF, var0)
|
||||
RPC_GENERATION_CALL2(test_svr_t, 1, query,
|
||||
rpc_ref_array_uint32_t_uint8_t_32_t, RPC_DIR_IN, RPC_TYPE_DATA, var0, rpc_int_t, RPC_DIR_IN, RPC_TYPE_DATA, var1)
|
||||
|
||||
#include <string.h>
|
||||
void rpc_test(void)
|
||||
{
|
||||
rpc_int_t var0 = {.data = 1};
|
||||
msg_tag_t tag = test_svr_t_register_call(15, &var0);
|
||||
|
||||
rpc_ref_array_uint32_t_uint8_t_32_t str_tst = {
|
||||
.data = "test",
|
||||
.len = strlen("test") + 1};
|
||||
|
||||
test_svr_t_query_call(15, &str_tst, &var0);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
void irq_test(void);
|
||||
void rpc_test(void);
|
||||
Reference in New Issue
Block a user