当前位置:网站首页>OpenHarmony模块二下文件samgr_server解析(1)
OpenHarmony模块二下文件samgr_server解析(1)
2022-07-15 17:14:00 【爱摸鱼的伪程序猿】
distributedschedule_samgr_lite/samgr_server/source/samgr_server.h
distributedschedule_samgr_lite/samgr_server/source/samgr_server.c
samgr_server.h
头文件中,简要定义了远程寄存器模块的一个结构体
typedef struct RemoteRegister RemoteRegister; //远程寄存器
struct RemoteRegister {
MutexId mtx; //互斥ID
Endpoint *endpoint; //端点
Vector clients; //向量客户端
};
samgr_server.c
文件开头定义了许多宏定义,和全局调用的函数
#define LOG_TAG "Samgr"
#define LOG_DOMAIN 0xD001800
typedef int(*ProcFunc)(SamgrServer *server, int32 option, void *origin, IpcIo *req, IpcIo *reply);
#define MAX_SA_SIZE 0x100
#define RETRY_TIMES 3
#define RETRY_INTERVAL 1
#define UID_HAP 10000
#define MAX_SYSCAP_NUM_PER_REPLY 118
获取要素名称功能
static const char *GetName(Service *service);
//feature表示指向该功能的指针
初始化用户的身份信息
static BOOL Initialize(Service *service, Identity identity);
//identity指示初始化的用户的身份
//service指示指向服务的指针。
定义服务的任务配置
static TaskConfig GetTaskConfig(Service *service);
处理服务消息
static BOOL MessageHandle(Service *service, Request *request);
//service指示指向服务的指针。
//request表示指向请求数据的指针。
从客户端向IServerProxy发送IPC消息
static int32 Invoke(IServerProxy *iProxy, int funcId, void *origin, IpcIo *req, IpcIo *reply);
//proxy表示客户端代理对象的指针。
//funcId表示在服务器上实现的函数的ID。
//req指示指向序列化请求消息的指针。
在终端运行结束时调用
static int OnEndpointExit(const IpcContext *context, void* ipcMsg, IpcIo* data, void* argv);
进程终端
static int ProcEndpoint(SamgrServer *server, int32 option, void *origin, IpcIo *req, IpcIo *reply);
//进程输出特性
static int32 ProcPutFeature(SamgrServer *server, const void *origin, IpcIo *req, IpcIo *reply, SvcIdentity *identity);
//进程获取功能
static int32 ProcGetFeature(SamgrServer *server, const void *origin, IpcIo *req, IpcIo *reply, SvcIdentity *identity);
//进程特征
static int ProcFeature(SamgrServer *server, int32 option, void *origin, IpcIo *req, IpcIo *reply);
//注册Samgr端点
static int RegisterSamgrEndpoint(const IpcContext* context, SvcIdentity* identity);
//传送服务信息的策略
static void TransmitPolicy(int ret, const SvcIdentity* identity, IpcIo *reply,
const PolicyTrans *policy, uint32 policyNum);
//传输固定策略
static void TransmitFixedPolicy(IpcIo *reply, PolicyTrans policy);
//Ipc身份验证接口
static IpcAuthInterface *GetIpcAuthInterface(void);
//程序系统上限
static int ProcSysCap(SamgrServer *server, int32 option, void *origin, IpcIo *req, IpcIo *reply);
//解析系统上限
static void ParseSysCap(void);
今天先介绍该文件中所调用的几条简单函数,剩下的函数将在后续博客中介绍。
边栏推荐
- CSDN中Markdown设置表格列宽度
- ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the
- If you don't want to step on those holes in SaaS, you must first understand the "SaaS architecture"
- mysql中 decimal(10,2)格式的通过stream 方式写到 kafka 变成 stri
- LeeCode机器人的运动范围
- 请问通达信如何开户?请问手机开户股票开户安全吗?
- Mysql高版本报sql_mode=only_full_group_by异常
- Fosai biology interprets the changes in the atmospheric environment in the first half of 2022, and VOCs control is still the key to breaking the situation
- [problems of dft/fft - solutions to fence effect]
- C语言:使用宏重定义printf,打印【debug调试信息】
猜你喜欢

Operation priority of self increasing (self decreasing) operator

前六章补充案例和知识点(一)

Redis installation & startup

Millimeter wave radar learning (V) -- angle estimation

9. MySQL -- getting started with JDBC

日志的管理

8. MySQL -- trigger

YYS鼠标连点器

The characteristics and underlying principles of synchronized, as well as the state and expansion and upgrading process of locks

08 semi automatic annotation of target detection data set
随机推荐
@Repository @[email protected] 注解的理解
Introduction to C language (6)
urllib. error. URLError: <urlopen error [Errno 11004] getaddrinfo failed>
openCV入门----VS怎么安装openCV库
php 生成excel表的2种方法
每日一题:数组中最大数对和的最小值(LeeCode)
如何使用HHDBCS对PolarDB for PostgreSQL存储过程进行调试?
用命令行登录并操作数据库
A rate distortion optimization of h264 encoder (1)
The more you sell, the less you earn? Financial analysis thinking of profit growth rate lower than sales growth rate
TP5的whereOr方法多条件存在
利用chardet检测网页编码
C language: code specification Discussion & excerpts (including excerpts from some rules of [Huawei code specification])
C 语言入门(六)
for循环的执行顺序
CSDN中Markdown设置表格列宽度
Dictionary tree (trie tree)
Pass value, reference and pointer
Makefile variable assignment
What is the distributed query engine of polardb for PostgreSQL?