鸿蒙源码分析(五十九)

registry文件-A核进程间服务调用的对外接口定义

samgr中注册表api解释

这个文件都是些对外的调用接口api,大致的变量指向api都在代码中注释。都是cortex-A核进程间服务调用的对外接口定义。
Provider: 服务的提供者,为系统提供能力(对外接口)。
Consumer: 服务的消费者,调用服务提供的功能(对外接口)。
Samgr: 作为中介者,管理Provider提供的能力,同时帮助Consumer发现Provider的能力。
SamgrLite: 主要提供服务的注册与发现能力。
Service: 开发服务时,需要实现的服务的生命周期接口。
Feature: 开发功能时,需要实现的功能的生命周期接口。
IUnknown: 基于IUnknown开发服务或功能的对外接口。
IClientProxy: IPC调用时,消费者的消息发送代理。
IServerProxy: IPC调用时,开发者需要实现提供者的消息处理接口。
这个是注册服务的api

int __attribute__((weak)) SAMGR_RegisterServiceApi(const char *service, const char *feature,
                                                   const Identity *identity, IUnknown *iUnknown)
{
    (void)service; //开发服务时,需要实现的服务的生命周期接口。
    (void)feature;//开发功能时,需要实现的功能的生命周期接口
    (void)iUnknown; //基于IUnknown开发服务或功能的对外接口。
    (void)identity; //身份验证api
    return EC_FAILURE;
}

寻找服务api

IUnknown *__attribute__((weak)) SAMGR_FindServiceApi(const char *service, const char *feature)
{
    (void)service;
    (void)feature;
    return NULL;
}

系统注册能力的api

int32 __attribute__((weak)) SAMGR_RegisterSystemCapabilityApi(const char *sysCap, BOOL isReg)
{
    (void)sysCap;  //系统能力api
    (void)isReg;
    return EC_FAILURE;
}

查询系统能力Api

BOOL __attribute__((weak)) SAMGR_QuerySystemCapabilityApi(const char *sysCap)
{
    (void)sysCap;
    return FALSE;
}

获取系统能力Api

int32 __attribute__((weak)) SAMGR_GetSystemCapabilitiesApi(char sysCaps[MAX_SYSCAP_NUM][MAX_SYSCAP_NAME_LEN],
                                                           int32 *size)
{
    (void)sysCaps;
    (void)size;
    return EC_FAILURE;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值