User Tools

Site Tools


C++ API changes for IPv6

As with the C API changes, these are made because of new requirements of IPv6. They are not the only way to meet the new requirements. They are changes that meet the requirements and minimize changes to the existing C++ API. Feel free to propose changes to the C++ API, keeping in mind the new requirements.

Summary of C++ API changes

  • New definition for OCConnectivityType
  • Limitation on OCResource get, put, post, observe calls
  • Slightly broken Subscribe

New definition for OCConnectivityType

The only place OCConnectivityType is used in the C++ API is in OCPlatform::findResource and OCPlatform::findDevice. For those methods, only the information from OCTransportFlags is needed since the adapter type is not needed or used for discovery. See the new definition of OCConnectivity in OCConnectivityType.

Limitation on OCResource get, put, post, observe calls

In the past, a value in the url argument of get, put, etc. methods of OCResource could be used to set the network target of those methods. This was not documented, but it is used in some examples, leading to some confusion for developers. The new C++ API eliminates this capability for two reasons:

  • There is not enough information available in the url string to properly direct the message now. (Remember, it needs all the information in OCDevAddr.) In order to restore the capability, we will need to provide new get, put, etc., methods with the additional addressing information. (In other words, the old capability was broken once the connectivity abstraction was added, and we just didn’t know it.)
  • In order to simplify the documentation of the C++ API, we should assume all client OCResource objects are created by discovery, which provides all the network addressing information implicitly as part of the OCResource object.

Slightly broken Subscribe

Subscribe returns a network address string in its callback function. A string hasn’t been sufficient since the connectivity abstraction arrived, and it is even less so with the arrival of IPv6. The Subscribe capability needs to be rethought from a couple of perspectives, so it wasn’t upgraded in the current C++ API changes.

the_c_api_changes_for_ipv6.txt · Last modified: 2015/05/21 15:53 by John Light