NOTE :- THIS IS THE DEVELOPMENT VERSION 1.0
, (*1)
Installation
{
"require": {
"particleio/console": "dev-master"
}
}
Then Run :-
bash
composer update
, (*2)
Configuration
Particle\Console\ParticlesServiceProvider::class,
, (*3)
write use, (*4)
Particle\Console\Http\Controllers\ParticleController as Particle;
at the top of your controller.
, (*5)
Usage
initiate object like, (*6)
$obj = new Particle();
for login use, (*7)
$obj->Auth($user_id, $password);
List All Devices in a account
this method accepts only one parameter thats access token
, (*8)
Method Signature :-
$obj->ListDevices($token)
Transfer ownership
this method transfer ownership of a particle through third party website of a particlebr/
this method accespts two param 1. access token and 2. device id br/, (*9)
Method Signature : -
$obj->RequestDeviceTransfer($token, $device_id)
Claim a Device Through usb
this method claim a brand new device in your particle console through usb (No need of particle app) . Accepts two parameters 1. access token 2. device id
, (*10)
Method Signature : -
$obj->claimDeviceOverUsb($token, $device_id)
Delete an access token
this method will delete an access token access three params 1. user id 2. password 3. access token you want to deletebr/, (*11)
Method Signature :-
$obj->delAccessToken($user_id, $password, $token_to_del)
this method accept two params 1. device id, 2.access token.br/, (*12)
Method Signature:-
$obj->getDeviceInfo($device_ID, $access_token)
Unclaim a device:-
this method accept two params 1. device id (which you want to remove) 2. access token br/, (*13)
Method Signature:-
$obj->unClaimDevice($device_ID, $access_token)
Rename a device :-
this method accept three params 1. device_ID, 2. access_token, 3. desired_name br/, (*14)
Method Signature :-
$obj->renameDevice($device_ID, $access_token, $desired_name);
Burn Particle with your code snippet :-
this method accept 4 params :-, (*15)
-
1. directory= nullable (pass the param like '' -> blank if you dont wana put a directory it will create its own)
or put your own directory.
-
2.device_ID
-
3.access_token
-
4. code_snippet -> create a variable with your code snippet like
```php
$code = "int led=D7;void setup(){pinMode(led,OUTPUT); digitalWrite(led, HIGH);}";
```
and pass it.
Method Signature :-
$obj->postCodeSnippet($directory, $device_ID, $access_token, $code_snippet);
or, (*16)
$obj->postCodeSnippet('', $device_ID, $access_token, $code_snippet);