tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
microtvm_rpc_server.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
25 #ifndef TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
26 #define TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
27 
28 #include <stdlib.h>
29 #include <sys/types.h>
31 
32 #include "../../../../src/support/ssize.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
46 typedef ssize_t (*microtvm_rpc_channel_write_t)(void* context, const uint8_t* data,
47  size_t num_bytes);
48 
50 typedef void* microtvm_rpc_server_t;
51 
64  void* write_func_ctx);
65 
76  size_t* new_data_size_bytes);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif // TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
Defines integral error codes returned by the CRT.
tvm_crt_error_t
Definition: error_codes.h:50
void * microtvm_rpc_server_t
Opaque pointer type to TVM RPC Server.
Definition: microtvm_rpc_server.h:50
microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void *write_func_ctx)
Initialize the TVM RPC Server.
ssize_t(* microtvm_rpc_channel_write_t)(void *context, const uint8_t *data, size_t num_bytes)
TVM RPC channel write function.
Definition: microtvm_rpc_server.h:46
tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server, uint8_t **new_data, size_t *new_data_size_bytes)
Do any tasks suitable for the main thread, and maybe process new incoming data.