2017 © Pedro Peláez
 

library aliyun-open-api-iot

The IOT SDK for Aliyun OpenAPI

image

yuzewang/aliyun-open-api-iot

The IOT SDK for Aliyun OpenAPI

  • Thursday, July 28, 2016
  • by yuze
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

The IOT SDK for Aliyun OpenAPI

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

The IOT SDK for Aliyun OpenAPI, (*2)

Install

Via Composer, (*3)

``` bash $composer require yuzewang/aliyun-open-api-iot, (*4)


## Usage ```php use Aliyun\Core\Regions\Endpoint; use Aliyun\Core\Regions\EndpointConfig; use Aliyun\Core\Regions\EndpointProvider; use Aliyun\Core\Profile\DefaultProfile; use Aliyun\IOT\Request\RegistDeviceRequest; use Aliyun\Core\DefaultAcsClient; /** * 访问信息 */ $config = [ 'AccessKeyId'=>'<your access_key_id>', 'AccessKeySecret'=>'<your access_key_secret>', 'ProductKey'=>'<your product_key>', ]; /** * 配置网关 */ $endpoint = new Endpoint('cn-shanghai', EndpointConfig::getRegionIds(), EndpointConfig::getProductDomains()); EndpointProvider::setEndpoints([ $endpoint ]); /** * 授权资料 */ $profile = DefaultProfile::getProfile('cn-shanghai', $config['AccessKeyId'], $config['AccessKeySecret']); /** * 发消息到指定的Topic */ $client = new DefaultAcsClient($profile); $request = new Iot\PubRequest(); $request->setAppKey($config['ProductKey']); $request->setTopicFullName($appKey . "/deviceId/" . $deviceId); print_r($request->getTopicFullName()); print_r("\r\n"); $request->setMessageContent(base64_encode("open")); $response = $client->getAcsResponse($request); print_r($response); print_r("\r\n"); sleep(10); $request->setMessageContent(base64_encode("close")); $response = $client->getAcsResponse($request); print_r($response); print_r("\r\n"); [官方文档](https://help.aliyun.com/document_detail/30568.html?spm=5176.doc30594.6.134.zdfioe) ## Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ``` bash $ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*5)

Security

If you discover any security related issues, please email yuze89@gmail.com instead of using the issue tracker., (*6)

Credits

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

28/07 2016

dev-master

9999999-dev https://github.com/yuzewang/aliyun-open-api-iot

The IOT SDK for Aliyun OpenAPI

  Sources   Download

MIT

The Requires

 

The Development Requires

by yuze wang

php sdk iot aliyun

28/07 2016

v0.0.2

0.0.2.0 https://github.com/yuzewang/aliyun-open-api-iot

The IOT SDK for Aliyun OpenAPI

  Sources   Download

MIT

The Requires

 

The Development Requires

by yuze wang

php sdk iot aliyun

12/07 2016

v0.0.1

0.0.1.0 https://github.com/yuzewang/aliyun-open-api-iot

The IOT SDK for Aliyun OpenAPI

  Sources   Download

MIT

The Requires

 

The Development Requires

by yuze wang

php sdk iot aliyun