Endpoint Properties
A camera endpoint exposes several properties to platform that can be accessed through Access library.
For now, we only get AI container information from camera.
AI Container
Smarter AI Camera Platform deploys AI Containers to the edge, seamlessly, securely, and over-the-air. In this section, we will guide you about getting the information regarding deployed AI container in your cameras. The AI container information is accessed through Access library.
To know more about AI container, visit our official website here.
Getting AI Container Information
To get the information of the AI Container running on the camera from Access, follow the steps below:
AndroidImplement
Access.GetEndpointPropertyListenerand register it by callingRegisterGetEndpointPropertyListener(GetEndpointPropertyListener listener)method fromAccessclass. This is required to be registered only once.AnyConnectApi.get().getAccess().RegisterGetEndpointPropertyListener(listener);To fetch AI Container data, call
getProperties(long endpointId)fromAccessclass.AnyConnectApi.get().getAccess().getProperties(endpointId)You will get AI container information through the
onGetEndpointProperty(int status, HashMap<String, String> endpointProperties)method of the registered interface.listener = new Access.GetEndpointPropertyListener() { @Override public void onGetEndpointProperty(int status, HashMap<String, String> endpointProperties) { // apiStatus, 0 for successful response // endpointProperties, contains the properties of endpoint including AI container information parse(endpointProperties); } }; static final String TRAITS_AI_MODELS = "TRAITS_AI_MODELS"; void parse(HashMap<String, String> endpointProperties) { if (endpointProperties != null) { String aiContainerInformation = endpointProperties.get(TRAITS_AI_MODELS); if(aiContainerInformation != null){ //parse the info regarding AI //A sample aiContainerInformation is like //modelname=face-detection-adas-0001 + "\r\n" + modelversion=1.1 + "\r\n" + modelformat= + "\r\n" + modelgroupID=2056 } } }
iOSCall
getProperties(Endpoint endpointId, EndpointPropertiesCallback callback)method ofAccessclass.Declaration of
EndpointPropertiesCallbackis:typedef std::function<void(const int apiStatus, const types::Properties properties)> EndpointPropertiesCallback;and declaration of
Propertiestype is:typedef std::map<std::string, std::string> Properties;You will get AI container information through the
EndpointPropertiesCallbackcallback method as a list. Sample code example is:AccessRet accessRet = access->getProperties(endpointID, [] (const int apiStatus, const types::Properties properties) { // apiStatus, 0 for successful response // properties, contains the properties of endpoint including AI container information if(apiStatus==OK) { NSMutableDictionary *propertiesDict = [[NSMutableDictionary alloc] init]; for(auto& element: properties) { [propertiesDict setObject:[NSString stringWithFormat:@"%s",element.second.c_str()] forKey:[NSString stringWithFormat:@"%s",element.first.c_str()]]; } NSString* traitsAIInformation = propertiesDict[@"TRAITS_AI_MODELS"]; if(traitsAIInformation != null){ //parse the info regarding AI //A sample traitsAIInformation is like //modelname=face-detection-adas-0001 + "\r\n" + modelversion=1.1 + "\r\n" + modelformat= + "\r\n" + modelgroupID=2056 } } });
Updated about 1 month ago