Home
last modified time | relevance | path

Searched refs:NapiUtil (Results 1 – 25 of 40) sorted by relevance

12

/base/hiviewdfx/hiappevent/frameworks/js/napi/src/
Dnapi_hiappevent_watch.cpp48 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg(NAME_PROPERTY)); in IsValidName()
51 if (!NapiUtil::IsString(env, name)) { in IsValidName()
52NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg(NAME_PROPERTY, "string")); in IsValidName()
55 if (!IsValidWatcherName(NapiUtil::GetString(env, name))) { in IsValidName()
56 NapiUtil::ThrowError(env, NapiError::ERR_INVALID_WATCHER_NAME, "Invalid watcher name."); in IsValidName()
67 if (!NapiUtil::IsObject(env, cond)) { in IsValidCondition()
68NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg(COND_PROPERTY, "TriggerCond… in IsValidCondition()
72 napi_value propValue = NapiUtil::GetProperty(env, cond, propName); in IsValidCondition()
76 if (!NapiUtil::IsNumber(env, propValue)) { in IsValidCondition()
77NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg(propName, "number")); in IsValidCondition()
[all …]
Dnapi_hiappevent_builder.cpp40 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("domain"), isV9_); in IsValidEventDomain()
43 if (!NapiUtil::IsString(env, domain)) { in IsValidEventDomain()
44NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("domain", "string"), isV9_); in IsValidEventDomain()
53 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("name"), isV9_); in IsValidEventName()
56 if (!NapiUtil::IsString(env, name)) { in IsValidEventName()
57NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("name", "string"), isV9_); in IsValidEventName()
66 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("eventType"), isV9_); in IsValidEventType()
69 …if (!NapiUtil::IsNumber(env, type) || !OHOS::HiviewDFX::IsValidEventType(NapiUtil::GetInt32(env, t… in IsValidEventType()
70NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("eventType", "EventType"), … in IsValidEventType()
79 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("params"), isV9_); in IsValidEventParam()
[all …]
Dnapi_app_event_holder.cpp49 auto holder = new(std::nothrow) NapiAppEventHolder(NapiUtil::GetString(env, params[0])); in NapiConstructor()
69 NapiUtil::SetNamedProperty(env, exports, HOLDER_CLASS_NAME, holderClass); in NapiExport()
70 constructor_ = NapiUtil::CreateReference(env, holderClass); in NapiExport()
81 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("size")); in NapiSetSize()
84 if (!NapiUtil::IsNumber(env, params[0])) { in NapiSetSize()
85 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("size", "number")); in NapiSetSize()
88 if (int num = NapiUtil::GetInt32(env, params[0]); num >= 0) { in NapiSetSize()
93 NapiUtil::ThrowError(env, NapiError::ERR_INVALID_SIZE, "Invalid size value."); in NapiSetSize()
95 return NapiUtil::CreateUndefined(env); in NapiSetSize()
106 return NapiUtil::CreateNull(env); in NapiTakeNext()
[all …]
Dnapi_hiappevent_config.cpp35 if (!NapiUtil::IsObject(env, configObj)) { in Configure()
36NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("config", "ConfigOption"), … in Configure()
41 NapiUtil::GetPropertyNames(env, configObj, keys); in Configure()
46 napi_value value = NapiUtil::GetProperty(env, configObj, key); in Configure()
47 if (CONFIG_OPTION_MAP.at(key) != NapiUtil::GetType(env, value)) { in Configure()
48 std::string errMsg = NapiUtil::CreateErrMsg(key, CONFIG_OPTION_MAP.at(key)); in Configure()
49 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, errMsg, isThrow); in Configure()
52 …if (!HiAppEventConfig::GetInstance().SetConfigurationItem(key, NapiUtil::ConvertToString(env, valu… in Configure()
54 NapiUtil::ThrowError(env, NapiError::ERR_INVALID_MAX_STORAGE, errMsg, isThrow); in Configure()
Dnapi_hiappevent_js_v9.cpp38 size_t paramNum = NapiUtil::GetCbInfo(env, info, params); in Write()
72 if (NapiUtil::GetCbInfo(env, info, params) < 1) { // The min num of params for configure is 1 in Configure()
73 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("config")); in Configure()
85 return NapiUtil::CreateUndefined(env); in ClearData()
91 if (NapiUtil::GetCbInfo(env, info, params) < 1) { // The min num of params for addWatcher is 1 in AddWatcher()
92 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("watcher")); in AddWatcher()
101 … if (NapiUtil::GetCbInfo(env, info, params) < 1) { // The min num of params for removeWatcher is 1 in RemoveWatcher()
102 NapiUtil::ThrowError(env, NapiError::ERR_PARAM, NapiUtil::CreateErrMsg("watcher")); in RemoveWatcher()
Dnapi_hiappevent_init.cpp53 eventTypeMap["FAULT"] = NapiUtil::CreateInt32(env, FAULT_EVENT_TYPE); in InitEventTypeMap()
54 eventTypeMap["STATISTIC"] = NapiUtil::CreateInt32(env, STATISTIC_EVENT_TYPE); in InitEventTypeMap()
55 eventTypeMap["SECURITY"] = NapiUtil::CreateInt32(env, SECURITY_EVENT_TYPE); in InitEventTypeMap()
56 eventTypeMap["BEHAVIOR"] = NapiUtil::CreateInt32(env, BEHAVIOR_EVENT_TYPE); in InitEventTypeMap()
61 eventMap["USER_LOGIN"] = NapiUtil::CreateString(env, "hiappevent.user_login"); in InitEventMap()
62 eventMap["USER_LOGOUT"] = NapiUtil::CreateString(env, "hiappevent.user_logout"); in InitEventMap()
63 …eventMap["DISTRIBUTED_SERVICE_START"] = NapiUtil::CreateString(env, "hiappevent.distributed_servic… in InitEventMap()
68 paramMap["USER_ID"] = NapiUtil::CreateString(env, "user_id"); in InitParamMap()
69 paramMap["DISTRIBUTED_SERVICE_NAME"] = NapiUtil::CreateString(env, "ds_name"); in InitParamMap()
70 paramMap["DISTRIBUTED_SERVICE_INSTANCE_ID"] = NapiUtil::CreateString(env, "ds_instance_id"); in InitParamMap()
Dnapi_hiappevent_write.cpp52 return errMap.find(result) == errMap.end() ? NapiUtil::CreateNull(env) : in BuildErrorByResult()
53 NapiUtil::CreateError(env, errMap.at(result).first, errMap.at(result).second); in BuildErrorByResult()
59 napi_value resource = NapiUtil::CreateString(env, "NapiHiAppEventWriter"); in Write()
71 results[ERR_INDEX] = NapiUtil::CreateNull(env); in Write()
72 results[VALUE_INDEX] = NapiUtil::CreateInt32(env, asyncContext->result); in Write()
77 results[ERR_INDEX] = NapiUtil::CreateObject(env, "code", in Write()
78 NapiUtil::CreateInt32(env, asyncContext->result)); in Write()
80 results[VALUE_INDEX] = NapiUtil::CreateNull(env); in Write()
Dnapi_app_event_watcher.cpp88 context_->holder = NapiUtil::CreateReference(env, holder); in InitHolder()
118 napi_value callback = NapiUtil::GetReferenceValue(context->env, context->onTrigger); in OnTrigger()
126 NapiUtil::CreateInt32(context->env, context->row), in OnTrigger()
127 NapiUtil::CreateInt32(context->env, context->size), in OnTrigger()
128 NapiUtil::GetReferenceValue(context->env, context->holder) in OnTrigger()
147 context_->onTrigger = NapiUtil::CreateReference(env, triggerFunc); in InitTrigger()
Dnapi_hiappevent_js.cpp41 return NapiUtil::CreateUndefined(env); in Write()
56 napi_value promise = NapiUtil::CreateUndefined(env); in Write()
74 return NapiUtil::CreateBoolean(env, false); in Configure()
76 return NapiUtil::CreateBoolean(env, NapiHiAppEventConfig::Configure(env, params[0])); in Configure()
/base/telephony/core_service/frameworks/js/network_search/src/
Dnapi_radio.cpp158 NapiUtil::SetPropertyInt32(env, callbackValue, "psRadioTech", asyncContext->psTech); in GetRadioTechCallback()
159 NapiUtil::SetPropertyInt32(env, callbackValue, "csRadioTech", asyncContext->csTech); in GetRadioTechCallback()
162NapiUtil::ConverErrorMessageWithPermissionForJs(asyncContext->errorCode, "getRadioTech", GET_NETWO… in GetRadioTechCallback()
163 callbackValue = NapiUtil::CreateErrorMessage(env, error.errorMessage, error.errorCode); in GetRadioTechCallback()
165 NapiUtil::Handle2ValueCallback(env, asyncContext, callbackValue); in GetRadioTechCallback()
173 return NapiUtil::MatchParameters(env, parameters, { napi_number }); in MatchGetRadioTechParameter()
176 return NapiUtil::MatchParameters(env, parameters, { napi_number, napi_function }); in MatchGetRadioTechParameter()
193 NapiUtil::ThrowParameterError(env); in GetRadioTech()
199 NapiUtil::ThrowParameterError(env); in GetRadioTech()
206 return NapiUtil::HandleAsyncWork( in GetRadioTech()
[all …]
/base/telephony/sms_mms/frameworks/js/napi/src/
Dnapi_sms.cpp88 if (!NapiUtil::HasNamedTypeProperty(env, object, beg->second, beg->first)) { in MatchObjectProperty()
115 return NapiUtil::ToUtf16(str8); in GetU16StrFromNapiValue()
210 JsError error = NapiUtil::ConverErrorMessageWithPermissionForJs( in SendMessageCallback()
213 callbackValue = NapiUtil::CreateErrorMessage(env, error.errorMessage, error.errorCode); in SendMessageCallback()
215 NapiUtil::Handle1ValueCallback(env, asyncContext, callbackValue); in SendMessageCallback()
220 bool match = (parameterCount == 1) && NapiUtil::MatchParameters(env, parameters, {napi_object}); in MatchSendMessageParameters()
225 bool hasSlotId = NapiUtil::HasNamedTypeProperty(env, object, napi_number, g_slotIdStr); in MatchSendMessageParameters()
226 …bool hasDestinationHost = NapiUtil::HasNamedTypeProperty(env, object, napi_string, g_destinationHo… in MatchSendMessageParameters()
227 bool hasContent = NapiUtil::HasNamedProperty(env, object, g_contentStr); in MatchSendMessageParameters()
232 napi_value contentValue = NapiUtil::GetNamedProperty(env, object, g_contentStr); in MatchSendMessageParameters()
[all …]
Dnapi_mms.cpp356 NapiUtil::SetPropertyStringUtf8(env, attachment, "path", context.path); in CreateAttachmentValue()
357 NapiUtil::SetPropertyStringUtf8(env, attachment, "fileName", context.fileName); in CreateAttachmentValue()
358 NapiUtil::SetPropertyStringUtf8(env, attachment, "contentId", context.contentId); in CreateAttachmentValue()
359 NapiUtil::SetPropertyStringUtf8(env, attachment, "contentLocation", context.contentLocation); in CreateAttachmentValue()
360 NapiUtil::SetPropertyInt32( in CreateAttachmentValue()
362NapiUtil::SetPropertyStringUtf8(env, attachment, "contentTransferEncoding", context.contentTransfe… in CreateAttachmentValue()
363 NapiUtil::SetPropertyStringUtf8(env, attachment, "contentType", context.contentType); in CreateAttachmentValue()
364 NapiUtil::SetPropertyBoolean(env, attachment, "isSmil", context.isSmil); in CreateAttachmentValue()
365 NapiUtil::SetPropertyInt32(env, attachment, "charset", context.charset); in CreateAttachmentValue()
375 NapiUtil::SetPropertyStringUtf8(env, addressObj, "address", mmsAddress.GetAddressString()); in ParseAddress()
[all …]
Ddelivery_callback.cpp63 callbackValues[0] = NapiUtil::CreateUndefined(env_); in CompleteSmsDeliveryWork()
76 callbackValues[0] = NapiUtil::CreateErrorMessage(env_, "invalid delivery report"); in CompleteSmsDeliveryWork()
77 callbackValues[1] = NapiUtil::CreateUndefined(env_); in CompleteSmsDeliveryWork()
113 pContext->pduStr = NapiUtil::ToUtf8(pdu); in OnSmsDeliveryResult()
/base/telephony/cellular_data/frameworks/js/napi/src/
Dnapi_cellular_data.cpp56 return NapiUtil::MatchParameters(env, parameters, {napi_function}); in MatchCellularDataParameters()
69 return NapiUtil::MatchParameters(env, parameters, {napi_number}); in MatchEnableCellularDataRoamingParameters()
71 return NapiUtil::MatchParameters(env, parameters, {napi_number, napi_function}); in MatchEnableCellularDataRoamingParameters()
151NapiUtil::CreateErrorMessage(env, "cellular data service unavailable", ERROR_SERVICE_UNAVAILABLE); in GetCellularDataStateCallback()
153 callbackValue = NapiUtil::CreateErrorMessage(env, "unkonwn error"); in GetCellularDataStateCallback()
156 NapiUtil::Handle2ValueCallback(env, asyncContext.release(), callbackValue); in GetCellularDataStateCallback()
177 return NapiUtil::HandleAsyncWork(env, asyncContext.release(), "GetCellularDataState", in GetCellularDataState()
185 NapiUtil::ThrowParameterError(env); in NativeIsCellularDataEnabled()
214 JsError error = NapiUtil::ConverErrorMessageWithPermissionForJs( in IsCellularDataEnabledCallback()
216 callbackValue = NapiUtil::CreateErrorMessage(env, error.errorMessage, error.errorCode); in IsCellularDataEnabledCallback()
[all …]
/base/hiviewdfx/hiview/plugins/faultlogger/interfaces/js/napi/
Dnapi_util.cpp20 napi_value NapiUtil::CreateErrorMessage(napi_env env, std::string msg) in CreateErrorMessage()
32 napi_value NapiUtil::CreateUndefined(napi_env env) in CreateUndefined()
39 void NapiUtil::SetPropertyInt32(napi_env env, napi_value object, std::string name, int32_t value) in SetPropertyInt32()
46 void NapiUtil::SetPropertyInt64(napi_env env, napi_value object, std::string name, int64_t value) in SetPropertyInt64()
53 void NapiUtil::SetPropertyStringUtf8(napi_env env, napi_value object, std::string name, std::string… in SetPropertyStringUtf8()
60 bool NapiUtil::IsMatchType(napi_env env, napi_value value, napi_valuetype type) in IsMatchType()
70 napi_value NapiUtil::CreateString(const napi_env env, const std::string& str) in CreateString()
80 void NapiUtil::ThrowError(napi_env env, int code, const std::string& msg, bool isThrow) in ThrowError()
92 std::string NapiUtil::CreateServiceErrMsg() in CreateServiceErrMsg()
97 std::string NapiUtil::CreateParamCntErrMsg() in CreateParamCntErrMsg()
[all …]
Dnapi_faultlogger.cpp116 NapiUtil::SetPropertyInt32(env, info, "pid", infoItem.pid); in FaultLogCompleteCallback()
117 NapiUtil::SetPropertyInt32(env, info, "uid", infoItem.uid); in FaultLogCompleteCallback()
118 NapiUtil::SetPropertyInt32(env, info, "type", infoItem.type); in FaultLogCompleteCallback()
119 NapiUtil::SetPropertyInt64(env, info, "timestamp", infoItem.ts); in FaultLogCompleteCallback()
120 NapiUtil::SetPropertyStringUtf8(env, info, "reason", infoItem.reason); in FaultLogCompleteCallback()
121 NapiUtil::SetPropertyStringUtf8(env, info, "module", infoItem.module); in FaultLogCompleteCallback()
122 NapiUtil::SetPropertyStringUtf8(env, info, "summary", infoItem.summary); in FaultLogCompleteCallback()
123 NapiUtil::SetPropertyStringUtf8(env, info, "fullLog", infoItem.fullLog); in FaultLogCompleteCallback()
130 callbackValue = NapiUtil::CreateErrorMessage(env, "get signal info list failed"); in FaultLogCompleteCallback()
137 …callbackValues[0] = faultLogInfoContext->resolved ? NapiUtil::CreateUndefined(env) : callbackValue; in FaultLogCompleteCallback()
[all …]
/base/telephony/state_registry/frameworks/js/napi/src/
Dnapi_state_registry.cpp70 NapiUtil::ThrowParameterError(env); in NativeOn()
98 NapiUtil::ThrowParameterError(env); in OnCallback()
105NapiUtil::ThrowError(env, JS_ERROR_TELEPHONY_PERMISSION_DENIED, OBSERVER_JS_PERMISSION_ERROR_STRIN… in OnCallback()
107 JsError error = NapiUtil::ConverErrorMessageForJs(asyncContext->errorCode); in OnCallback()
108 NapiUtil::ThrowError(env, error.errorCode, error.errorMessage); in OnCallback()
127 NapiUtil::ThrowParameterError(env); in On()
131 napi_value object = NapiUtil::CreateUndefined(env); in On()
137 napi_value slotId = NapiUtil::GetNamedProperty(env, object, "slotId"); in On()
150 NapiUtil::ThrowParameterError(env); in On()
159 NapiUtil::ThrowParameterError(env); in On()
[all …]
/base/telephony/core_service/frameworks/js/napi/
Dnapi_util.cpp85 std::string NapiUtil::GetErrorMessage(int32_t errorCode) in GetErrorMessage()
98 std::string NapiUtil::ToUtf8(std::u16string str16) in ToUtf8()
103 std::u16string NapiUtil::ToUtf16(std::string str) in ToUtf16()
108 napi_value NapiUtil::CreateErrorMessage(napi_env env, const std::string &msg, int32_t errorCode) in CreateErrorMessage()
121 napi_value NapiUtil::CreateUndefined(napi_env env) in CreateUndefined()
128 bool NapiUtil::MatchValueType(napi_env env, napi_value value, napi_valuetype targetType) in MatchValueType()
135 bool NapiUtil::MatchParameters( in MatchParameters()
151 void NapiUtil::SetPropertyInt32(napi_env env, napi_value object, const std::string &name, int32_t v… in SetPropertyInt32()
158 void NapiUtil::SetPropertyInt64(napi_env env, napi_value object, const std::string &name, int64_t v… in SetPropertyInt64()
165 void NapiUtil::SetPropertyStringUtf8(napi_env env, napi_value object, const std::string &name, cons… in SetPropertyStringUtf8()
[all …]
/base/update/updateservice/frameworks/js/napi/base/src/
Dnapi_util.cpp28 int32_t NapiUtil::GetInt32(napi_env env, napi_value arg, const std::string &attrName, int32_t &intV… in GetInt32()
40 int32_t NapiUtil::GetBool(napi_env env, napi_value arg, const std::string &attrName, bool &value) in GetBool()
52 int32_t NapiUtil::GetString(napi_env env, napi_value arg, const std::string &attrName, std::string … in GetString()
64 int32_t NapiUtil::GetString(napi_env env, napi_value arg, std::string &strValue) in GetString()
79 int32_t NapiUtil::SetString(napi_env env, napi_value arg, const std::string &attrName, const std::s… in SetString()
87 int32_t NapiUtil::SetInt32(napi_env env, napi_value arg, const std::string &attrName, int32_t intVa… in SetInt32()
95 int32_t NapiUtil::SetInt64(napi_env env, napi_value arg, const std::string &attrName, int64_t intVa… in SetInt64()
103 int32_t NapiUtil::SetBool(napi_env env, napi_value arg, const std::string &attrName, bool value) in SetBool()
111 ClientStatus NapiUtil::IsTypeOf(napi_env env, napi_value arg, napi_valuetype type) in IsTypeOf()
120 ClientStatus NapiUtil::CreateReference(napi_env env, napi_value arg, uint32_t refcount, napi_ref &r… in CreateReference()
[all …]
Ddefine_property.cpp27 {StringUtils::GetEnumValueString(#item), NapiUtil::CreateUint32(env, CAST_UINT((item)))}
30 {StringUtils::GetEnumValueString(#item), NapiUtil::CreateStringUtf8(env, (item))}
34 NapiUtil::CreateUint32(env, CAST_UINT(ClientHelper::ConvertToErrorCode(item)))}
71 NapiUtil::CreateProperty(env, exports, "CallResult", callResultList); in DefineCallResult()
99 NapiUtil::CreateProperty(env, exports, "UpgradeStatus", upgradeStatusList); in DefineUpgradeStatus()
107 NapiUtil::CreateProperty(env, exports, "ComponentType", componentTypeList); in DefineComponentType()
117 NapiUtil::CreateProperty(env, exports, "EffectiveMode", effectiveModeList); in DefineEffectiveMode()
129 NapiUtil::CreateProperty(env, exports, "NetType", netTypeList); in DefineNetType()
141 NapiUtil::CreateProperty(env, exports, "Order", orderList); in DefineOrder()
149 NapiUtil::CreateProperty(env, exports, "EventClassify", eventClassifyList); in DefineEventClassify()
[all …]
Dclient_helper.cpp69NapiUtil::SetInt32(env, napiDescriptInfo, "descriptionType", static_cast<int32_t>(descriptInfo.des… in BuildDescInfo()
70 NapiUtil::SetString(env, napiDescriptInfo, "content", descriptInfo.content.c_str()); in BuildDescInfo()
116 NapiUtil::SetString(env, napiComponentDescription, "componentId", in BuildComponentDescriptions()
140NapiUtil::SetString(env, napiVersionComponent, "componentId", versionComponents[i].componentId.c_s… in BuildVersionComponents()
141NapiUtil::SetInt32(env, napiVersionComponent, "componentType", versionComponents[i].componentType); in BuildVersionComponents()
142NapiUtil::SetString(env, napiVersionComponent, "upgradeAction", versionComponents[i].upgradeAction… in BuildVersionComponents()
143 NapiUtil::SetString( in BuildVersionComponents()
145NapiUtil::SetString(env, napiVersionComponent, "innerVersion", versionComponents[i].innerVersion.c… in BuildVersionComponents()
146 NapiUtil::SetInt32(env, napiVersionComponent, "size", versionComponents[i].size); in BuildVersionComponents()
147NapiUtil::SetInt32(env, napiVersionComponent, "effectiveMode", versionComponents[i].effectiveMode); in BuildVersionComponents()
[all …]
/base/usb/usb_manager/interfaces/kits/js/napi/src/
Dusb_info.cpp63 NapiUtil::JsObjectToInt(env, obj, "busNum", busNum); in ParseUsbDevicePipe()
66 NapiUtil::JsObjectToInt(env, obj, "devAddress", devAddr); in ParseUsbDevicePipe()
84 NapiUtil::SetValueInt32(env, "busNum", pipe.GetBusNum(), obj); in CreateUsbDevicePipe()
85 NapiUtil::SetValueInt32(env, "devAddress", pipe.GetDevAddr(), obj); in CreateUsbDevicePipe()
91 NapiUtil::SetValueUint32(env, "address", usbEndpoint.GetAddress(), obj); in CtoJSUsbEndpoint()
92 NapiUtil::SetValueUint32(env, "attributes", usbEndpoint.GetAttributes(), obj); in CtoJSUsbEndpoint()
93 NapiUtil::SetValueInt32(env, "interval", usbEndpoint.GetInterval(), obj); in CtoJSUsbEndpoint()
94 NapiUtil::SetValueInt32(env, "maxPacketSize", usbEndpoint.GetMaxPacketSize(), obj); in CtoJSUsbEndpoint()
95 NapiUtil::SetValueUint32(env, "direction", usbEndpoint.GetDirection(), obj); in CtoJSUsbEndpoint()
96 NapiUtil::SetValueUint32(env, "number", usbEndpoint.GetEndpointNumber(), obj); in CtoJSUsbEndpoint()
[all …]
Dnapi_util.cpp30 void NapiUtil::JsValueToString(const napi_env &env, const napi_value &value, const int32_t bufLen, … in JsValueToString()
48 void NapiUtil::JsObjectToString( in JsObjectToString()
81 bool NapiUtil::JsObjectGetProperty( in JsObjectGetProperty()
94 void NapiUtil::JsObjectToInt(const napi_env &env, const napi_value &object, std::string fieldStr, i… in JsObjectToInt()
112 void NapiUtil::JsObjectToUint( in JsObjectToUint()
145 bool NapiUtil::JsUint8ArrayParse( in JsUint8ArrayParse()
171 void NapiUtil::Uint8ArrayToJsValue( in Uint8ArrayToJsValue()
187 void NapiUtil::SetValueUtf8String(const napi_env &env, std::string fieldStr, std::string str, napi_… in SetValueUtf8String()
194 void NapiUtil::SetValueInt32(const napi_env &env, std::string fieldStr, const int32_t intValue, nap… in SetValueInt32()
201 void NapiUtil::SetValueUint32( in SetValueUint32()
[all …]
/base/telephony/call_manager/frameworks/js/napi/src/
Dnapi_call_manager.cpp1052 return NapiUtil::MatchParameters(env, parameters, { napi_string }); in MatchStringAndVariableObjectParameters()
1054 return NapiUtil::MatchParameters(env, parameters, { napi_string, napi_function }) || in MatchStringAndVariableObjectParameters()
1055 NapiUtil::MatchParameters(env, parameters, { napi_string, napi_null}) || in MatchStringAndVariableObjectParameters()
1056 NapiUtil::MatchParameters(env, parameters, { napi_string, napi_undefined }) || in MatchStringAndVariableObjectParameters()
1057 NapiUtil::MatchParameters(env, parameters, { napi_string, napi_object }); in MatchStringAndVariableObjectParameters()
1059 … return NapiUtil::MatchParameters(env, parameters, { napi_string, napi_object, napi_function }); in MatchStringAndVariableObjectParameters()
1070 NapiUtil::ThrowParameterError(env); in DialCall()
1075 NapiUtil::ThrowParameterError(env); in DialCall()
1099 NapiUtil::ThrowParameterError(env); in MakeCall()
1104 NapiUtil::ThrowParameterError(env); in MakeCall()
[all …]
/base/telephony/core_service/frameworks/js/sim/src/
Dnapi_sim.cpp69 JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value()); in NapiCreateAsyncWork()
70 NapiUtil::ThrowError(env, error.errorCode, error.errorMessage); in NapiCreateAsyncWork()
106 JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value()); in NapiCreateAsyncWork2()
107 NapiUtil::ThrowError(env, error.errorCode, error.errorMessage); in NapiCreateAsyncWork2()
137 napi_value errorMessage = NapiUtil::CreateErrorMessage(env, errMessage, errorCode); in NapiAsyncCompleteCallback()
141 …(funcIgnoreReturnVal ? NapiUtil::CreateUndefined(env) : GetNapiValue(env, asyncContext.callbackVal… in NapiAsyncCompleteCallback()
146 …(funcIgnoreReturnVal ? NapiUtil::CreateUndefined(env) : GetNapiValue(env, asyncContext.callbackVal… in NapiAsyncCompleteCallback()
147 napi_value callbackValue[] {NapiUtil::CreateUndefined(env), res}; in NapiAsyncCompleteCallback()
149 callbackValue[0] = NapiUtil::CreateErrorMessage(env, errMessage, errorCode); in NapiAsyncCompleteCallback()
150 callbackValue[1] = NapiUtil::CreateUndefined(env); in NapiAsyncCompleteCallback()
[all …]

12