Skip to content

Commit

Permalink
Bump to version 1.4.1 on 2018-07-16
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Cauchois committed Jul 16, 2018
1 parent b4d480a commit bde10ad
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 79 deletions.
69 changes: 34 additions & 35 deletions device/iothub_client_python/src/iothub_client_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define IMPORT_NAME iothub_client
#endif

#define VERSION_STRING "1.4.0"
#define VERSION_STRING "1.4.1"

#if PY_MAJOR_VERSION >= 3
#define IS_PY3
Expand Down Expand Up @@ -149,10 +149,10 @@ enum SECURITY_TYPE
#endif
#if USE_AMQP
AMQP,
#endif
#endif
#if USE_MQTT
MQTT,
#endif
#endif
#if USE_AMQP
AMQP_WS,
#endif
Expand Down Expand Up @@ -1058,8 +1058,8 @@ extern "C"
void
DeviceTwinCallback(
DEVICE_TWIN_UPDATE_STATE updateState,
const unsigned char* payLoad,
size_t size,
const unsigned char* payLoad,
size_t size,
void* userContextCallback
)
{
Expand Down Expand Up @@ -1130,10 +1130,10 @@ class DeviceMethodReturnValue
extern "C"
int
DeviceMethodCallback(
const char* method_name,
const unsigned char* payLoad,
size_t size,
unsigned char** response,
const char* method_name,
const unsigned char* payLoad,
size_t size,
unsigned char** response,
size_t* resp_size,
void* userContextCallback
)
Expand Down Expand Up @@ -1356,7 +1356,7 @@ class IoTHubClient
{
protected:
CLIENT_INTERFACE_TYPE client_interface_type;

static IOTHUB_CLIENT_TRANSPORT_PROVIDER
GetProtocol(IOTHUB_TRANSPORT_PROVIDER _protocol)
{
Expand Down Expand Up @@ -1394,7 +1394,7 @@ class IoTHubClient
PyErr_SetString(PyExc_TypeError, "IoTHubTransportProvider set to unknown protocol");
boost::python::throw_error_already_set();
break;
}
}
return protocol;
}

Expand Down Expand Up @@ -1422,7 +1422,7 @@ class IoTHubClient
}

IoTHubClient(
const IoTHubClient& client,
const IoTHubClient& client,
CLIENT_INTERFACE_TYPE _client_interface_type)
{
(void)client;
Expand Down Expand Up @@ -1459,7 +1459,7 @@ class IoTHubClient
PlatformCallHandler::Platform_Init();
iotHubClientHandle = IoTHubClient_CreateFromConnectionString("", GetProtocol(_protocol));

iotHubClientHandle = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
iotHubClientHandle = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_CreateFromConnectionString(connectionString.c_str(), GetProtocol(_protocol)) :
IoTHubModuleClient_CreateFromConnectionString(connectionString.c_str(), GetProtocol(_protocol));
}
Expand All @@ -1475,7 +1475,7 @@ class IoTHubClient
)
{
client_interface_type = _client_interface_type;

IOTHUB_CLIENT_CONFIG config;
config.protocol = GetProtocol(_config.protocol);
config.deviceId = _config.deviceId.c_str();
Expand Down Expand Up @@ -1504,7 +1504,7 @@ class IoTHubClient
)
{
client_interface_type = _client_interface_type;

IOTHUB_CLIENT_CONFIG config;
config.protocol = GetProtocol(_iotHubConfig->protocol);

Expand Down Expand Up @@ -1637,7 +1637,7 @@ class IoTHubClient
{
{
ScopedGILRelease release;
if (client_interface_type == CLIENT_INTERFACE_DEVICE)
if (client_interface_type == CLIENT_INTERFACE_DEVICE)
{
IoTHubDeviceClient_Destroy(iotHubClientHandle);
}
Expand Down Expand Up @@ -1675,7 +1675,7 @@ class IoTHubClient
sendContext->eventMessage = eventMessage.Clone();
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SendEventAsync(iotHubClientHandle, eventMessage.Handle(), SendConfirmationCallback, sendContext) :
IoTHubModuleClient_SendEventAsync(iotHubClientHandle, eventMessage.Handle(), SendConfirmationCallback, sendContext);
}
Expand All @@ -1691,7 +1691,7 @@ class IoTHubClient
IOTHUB_CLIENT_RESULT result = IOTHUB_CLIENT_OK;
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_GetSendStatus(iotHubClientHandle, &iotHubClientStatus) :
IoTHubModuleClient_GetSendStatus(iotHubClientHandle, &iotHubClientStatus);
}
Expand Down Expand Up @@ -1719,7 +1719,7 @@ class IoTHubClient
IOTHUB_CLIENT_RESULT result;
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetMessageCallback(iotHubClientHandle, ReceiveMessageCallback, receiveContext) :
IoTHubModuleClient_SetMessageCallback(iotHubClientHandle, ReceiveMessageCallback, receiveContext);
}
Expand All @@ -1746,8 +1746,8 @@ class IoTHubClient
IOTHUB_CLIENT_RESULT result;
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetConnectionStatusCallback(iotHubClientHandle, ConnectionStatusCallback, receiveContext) :
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetConnectionStatusCallback(iotHubClientHandle, ConnectionStatusCallback, receiveContext) :
IoTHubModuleClient_SetConnectionStatusCallback(iotHubClientHandle, ConnectionStatusCallback, receiveContext);
}
if (result != IOTHUB_CLIENT_OK)
Expand All @@ -1765,7 +1765,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetRetryPolicy(iotHubClientHandle, retryPolicy, retryTimeoutLimitInSeconds) :
IoTHubDeviceClient_SetRetryPolicy(iotHubClientHandle, retryPolicy, retryTimeoutLimitInSeconds) :
IoTHubModuleClient_SetRetryPolicy(iotHubClientHandle, retryPolicy, retryTimeoutLimitInSeconds);
}
if (result != IOTHUB_CLIENT_OK)
Expand All @@ -1782,7 +1782,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_GetRetryPolicy(iotHubClientHandle, &iotHubClientRetryPolicy, &retryTimeoutLimitInSeconds) :
IoTHubDeviceClient_GetRetryPolicy(iotHubClientHandle, &iotHubClientRetryPolicy, &retryTimeoutLimitInSeconds) :
IoTHubModuleClient_GetRetryPolicy(iotHubClientHandle, &iotHubClientRetryPolicy, &retryTimeoutLimitInSeconds);
}
if (result != IOTHUB_CLIENT_OK)
Expand Down Expand Up @@ -1815,7 +1815,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetDeviceTwinCallback(iotHubClientHandle, DeviceTwinCallback, deviceTwinContext) :
IoTHubDeviceClient_SetDeviceTwinCallback(iotHubClientHandle, DeviceTwinCallback, deviceTwinContext) :
IoTHubModuleClient_SetModuleTwinCallback(iotHubClientHandle, DeviceTwinCallback, deviceTwinContext);
}
if (result != IOTHUB_CLIENT_OK)
Expand Down Expand Up @@ -1845,7 +1845,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SendReportedState(iotHubClientHandle, (const unsigned char*)reportedState.c_str(), size, SendReportedStateCallback, sendReportedStateContext) :
IoTHubDeviceClient_SendReportedState(iotHubClientHandle, (const unsigned char*)reportedState.c_str(), size, SendReportedStateCallback, sendReportedStateContext) :
IoTHubModuleClient_SendReportedState(iotHubClientHandle, (const unsigned char*)reportedState.c_str(), size, SendReportedStateCallback, sendReportedStateContext);
}
if (result != IOTHUB_CLIENT_OK)
Expand Down Expand Up @@ -1904,7 +1904,7 @@ class IoTHubClient
throw IoTHubClientError(__func__, result);
}
}

void DeviceMethodResponse(
METHOD_HANDLE method_id,
std::string response,
Expand Down Expand Up @@ -1932,7 +1932,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_GetLastMessageReceiveTime(iotHubClientHandle, &lastMessageReceiveTime) :
IoTHubDeviceClient_GetLastMessageReceiveTime(iotHubClientHandle, &lastMessageReceiveTime) :
IoTHubModuleClient_GetLastMessageReceiveTime(iotHubClientHandle, &lastMessageReceiveTime);
}
if (result != IOTHUB_CLIENT_OK)
Expand Down Expand Up @@ -1977,7 +1977,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetOption(iotHubClientHandle, optionName.c_str(), stringValue.c_str()) :
IoTHubDeviceClient_SetOption(iotHubClientHandle, optionName.c_str(), stringValue.c_str()) :
IoTHubModuleClient_SetOption(iotHubClientHandle, optionName.c_str(), stringValue.c_str());
}
}
Expand All @@ -1988,7 +1988,7 @@ class IoTHubClient
{
ScopedGILRelease release;
result = (client_interface_type == CLIENT_INTERFACE_DEVICE) ?
IoTHubDeviceClient_SetOption(iotHubClientHandle, optionName.c_str(), &value) :
IoTHubDeviceClient_SetOption(iotHubClientHandle, optionName.c_str(), &value) :
IoTHubModuleClient_SetOption(iotHubClientHandle, optionName.c_str(), &value);
}
}
Expand Down Expand Up @@ -2198,7 +2198,7 @@ class IoTHubModuleClient : public IoTHubClient<IOTHUB_MODULE_CLIENT_HANDLE>
{
throw IoTHubClientError(__func__, result);
}
}
}

void SetInputMessageCallback(
std::string inputName,
Expand Down Expand Up @@ -2229,7 +2229,7 @@ class IoTHubModuleClient : public IoTHubClient<IOTHUB_MODULE_CLIENT_HANDLE>
void CreateFromEnvironment(IOTHUB_TRANSPORT_PROVIDER _protocol)
{
protocol = _protocol;

{
ScopedGILRelease release;
iotHubClientHandle = IoTHubModuleClient_CreateFromEnvironment(GetProtocol(_protocol));
Expand Down Expand Up @@ -2259,7 +2259,7 @@ class IoTHubModuleClient : public IoTHubClient<IOTHUB_MODULE_CLIENT_HANDLE>
int responseStatus;
unsigned char* responsePayload;
size_t responsePayloadSize;
result = IoTHubModuleClient_ModuleMethodInvoke(iotHubClientHandle, deviceId.c_str(), moduleId.c_str(), methodName.c_str(), methodPayload.c_str(), timeout, &responseStatus, &responsePayload, &responsePayloadSize);
if (result == IOTHUB_DEVICE_METHOD_OK)
Expand Down Expand Up @@ -2295,7 +2295,7 @@ class IoTHubModuleClient : public IoTHubClient<IOTHUB_MODULE_CLIENT_HANDLE>
int responseStatus;
unsigned char* responsePayload;
size_t responsePayloadSize;
result = IoTHubModuleClient_DeviceMethodInvoke(iotHubClientHandle, deviceId.c_str(), methodName.c_str(), methodPayload.c_str(), timeout, &responseStatus, &responsePayload, &responsePayloadSize);
if (result == IOTHUB_DEVICE_METHOD_OK)
Expand All @@ -2311,7 +2311,7 @@ class IoTHubModuleClient : public IoTHubClient<IOTHUB_MODULE_CLIENT_HANDLE>
}
return response;
#endif
}
}
};

using namespace boost::python;
Expand Down Expand Up @@ -2665,4 +2665,3 @@ BOOST_PYTHON_MODULE(IMPORT_NAME)
;

};

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define IMPORT_NAME provisioning_device_client
#endif

#define VERSION_STRING "1.4.0"
#define VERSION_STRING "1.4.1"

#if PY_MAJOR_VERSION >= 3
#define IS_PY3
Expand Down Expand Up @@ -302,7 +302,7 @@ extern "C"
void
RegisterDeviceCallback(
PROV_DEVICE_RESULT register_result,
const char* iothub_uri,
const char* iothub_uri,
const char* device_id,
void* user_context
)
Expand All @@ -312,7 +312,7 @@ RegisterDeviceCallback(
boost::python::object userContext = registerDeviceContext->userContext;
{
ScopedGILAcquire acquire;
try
try
{
register_callback(register_result, iothub_uri, device_id, userContext);
}
Expand All @@ -337,7 +337,7 @@ RegisterDeviceStatusCallback(
boost::python::object status_user_context = registerDeviceStatusContext->status_user_context;
{
ScopedGILAcquire acquire;
try
try
{
register_status_callback(reg_status, status_user_context);
}
Expand Down Expand Up @@ -620,7 +620,7 @@ BOOST_PYTHON_MODULE(IMPORT_NAME)

provisioningErrorType = createExceptionClass("ProvisioningError");
provisioningDeviceClientErrorType = createExceptionClass("ProvisioningDeviceClientError", provisioningErrorType);

enum_<PROV_DEVICE_REG_STATUS>("ProvisioningDeviceRegistrationStatus")
.value("CONNECTED", PROV_DEVICE_REG_STATUS_CONNECTED)
.value("REGISTERING", PROV_DEVICE_REG_STATUS_REGISTERING)
Expand Down
Loading

0 comments on commit bde10ad

Please sign in to comment.