pub mod event {
pub const CHANNEL_CONNECTED: u16 = 1;
pub const CHANNEL_DISCONNECTED: u16 = 2;
pub const LOCAL_SERVICE_ON: u16 = 3;
pub const LOCAL_SERVICE_OFF: u16 = 4;
pub const MESSAGE_IN: u16 = 5;
}
pub type SendMessageApi = extern "C" fn(
service_id: i64,
request_id: i64,
receiver_service_key: *const u8,
receiver_service_key_len: u32,
channel_id: i64,
buffer: *const u8,
buffer_size: u32,
);
pub type SleepApi = extern "C" fn(service_id: i64, request_id: i64, milliseconds: u64);
pub type FileApi = extern "C" fn(service_id: i64, request_id: i64, file_name: *const u8, len: u32);
pub type CloseFileApi = extern "C" fn(
service_id: i64,
request_id: i64
);
pub type WriteFileApi = extern "C" fn(
service_id: i64,
request_id: i64,
content: *const u8,
content_len: u32,
);
pub type SeekFileApi = extern "C" fn(
service_id: i64,
request_id: i64,
offset: u64
);
pub type ReadFileApi = extern "C" fn(
service_id: i64,
request_id: i64,
read_size: u64
);
pub type TransferFileApi = extern "C" fn(
service_id: i64,
request_id: i64,
buffer: *const u8,
buffer_len: u32,
);
pub type GenIDApi = extern "C" fn(service_id: i64) -> i64;
pub type ResponseApi = extern "C" fn(service_id: i64, request_id: i64, msg: *const u8, len: u32);
pub type OutputLogApi = extern "C" fn(service_id: i64, msg: *const u8, len: u32);
pub type LoadServiceApi = extern "C" fn(service_id: i64, request_id: i64, msg: *const u8, len: u32);
pub type UnLoadServiceApi =
extern "C" fn(service_id: i64, request_id: i64, msg: *const u8, len: u32);
pub type SendHttpRequestApi =
extern "C" fn(service_id: i64, request_id: i64, msg: *const u8, len: u32);
pub type GetHttpDataApi = extern "C" fn(service_id: i64, request_id: i64);
pub type GetHttpListenAddrApi = extern "C" fn(service_id: i64, request_id: i64);
pub type RemoveHttpClientApi = extern "C" fn(service_id: i64, request_id: i64);
pub type BuildChannelApi = extern "C" fn(service_id: i64, request_id: i64, node_id: i64);
pub type GetAllLocalServiceApi =
extern "C" fn(service_id: i64, request_id: i64, filter_system: bool);
pub type AddChannelIdToRemoteServicesApi = extern "C" fn(
service_id: i64,
request_id: i64,
channel_id: i64,
buffer: *const u8,
buffer_len: u32,
);
pub type RemoveRemoteServiceAllChannelIdApi = extern "C" fn(
service_id: i64,
request_id: i64,
channel_id: i64,
buffer: *const u8,
buffer_len: u32,
);
pub type SetChannelXRPCPortApi =
extern "C" fn(service_id: i64, request_id: i64, channel_id: i64, port: i32);
pub type GetXPRCPortApi = extern "C" fn(service_id: i64, request_id: i64) -> i32;
pub type GetAllConnIdApi = extern "C" fn(service_id: i64, request_id: i64);
pub type GetChannelIdByConnIdApi = extern "C" fn(service_id: i64, request_id: i64, conn_id: i64);
pub type SubscribeHandler = extern "C" fn(u16, data: *const u8, length: u32) -> bool;
pub type SubscribeApi = extern "C" fn(event_id: u16, u32, handler: SubscribeHandler) -> i64;
pub type UnSubscribeApi = extern "C" fn(event_id: u16, subscribe_id: i64);