/* File oc_endpoint.i */ %module OCEndpointUtil %include "stdint.i" %include "arrays_java.i" %include "iotivity.swg" %import "oc_uuid.i" %pragma(java) jniclasscode=%{ static { try { System.loadLibrary("iotivity-lite-jni"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load. \n" + e); System.exit(1); } } %} %{ #include "oc_endpoint.h" %} /*******************Begin oc_endpoint.h*********************/ %rename(OCEndpoint) oc_endpoint_t; // transport flags are pulled from hand generated class as `int` not `enum` %ignore transport_flags; //%rename (OCTransportFlags) transport_flags; %rename(DevAddr) dev_addr; //if uncommented the following apply lines will cause the output to be byte[] vs short[] //%apply signed char[ANY] { uint8_t address[4] }; //%apply signed char[ANY] { uint8_t address[16] }; %rename(OCIPv6Addr) oc_ipv6_addr_t; %rename(OCIPv4Addr) oc_ipv4_addr_t; %rename(OCLEAddr) oc_le_addr_t; %rename(addrLocal) addr_local; %rename(OCFVersion) ocf_version_t; %rename(interfaceIndex) interface_index; // look into exposing oc_make_ipv4_endpoint and oc_make_ipv6_endpoint %rename(newEndpoint) oc_new_endpoint; %rename(freeEndpoint) oc_free_endpoint; %rename(setDi) oc_endpoint_set_di; %apply oc_string_t *OUTPUT { oc_string_t *endpointStrOut }; %rename(toString) oc_endpoint_to_string; int oc_endpoint_to_string(oc_endpoint_t *endpoint, oc_string_t *endpointStrOut); %apply oc_string_t *INPUT { oc_string_t *endpoint_str }; %apply oc_string_t *OUTPUT { oc_string_t *uri }; %rename(stringToEndpoint) oc_string_to_endpoint; %rename(ipv6EndpointIsLinkLocal) oc_ipv6_endpoint_is_link_local; %rename(compare) oc_endpoint_compare; %rename(compareAddress) oc_endpoint_compare_address; %include "oc_endpoint.h" /*******************End oc_endpoint.h***********************/