chirpstack/api/php
Orne Brocaar 64b2e82244
Some checks failed
CI / tests (postgres) (push) Has been cancelled
CI / tests (sqlite) (push) Has been cancelled
CI / dist (postgres) (push) Has been cancelled
CI / dist (sqlite) (push) Has been cancelled
Bump version to 4.11.0-test.1
2024-12-11 09:33:27 +00:00
..
.gitignore api: Remove generated PHP code. (#452) 2024-07-09 12:15:16 +01:00
composer.json Bump version to 4.11.0-test.1 2024-12-11 09:33:27 +00:00
Makefile api: add grpc php support (#431) 2024-06-11 11:50:02 +01:00
README.md api: add grpc php support (#431) 2024-06-11 11:50:02 +01:00

chirpstack-api

ChirpStack gRPC API message and service wrappers for PHP.

Install

With composer:

composer require chirpstack/chirpstack-api

Usage

All messages, services, constants, etc. are auto-generated from the ChirpStack protobuf definitions. The result is that this package structure matches that of the protobuf definitions.

The protobuf definitions can be found here: https://github.com/chirpstack/chirpstack/tree/master/api/proto

Example

<?php

namespace Test;

use Chirpstack\API\ApplicationServiceClient;
use Chirpstack\API\ListApplicationsRequest;
use Grpc\Channel;
use Grpc\ChannelCredentials;

require dirname(__FILE__) . '/vendor/autoload.php';

function main() {
    $channel = new Channel('url',  ['credentials' => ChannelCredentials::createInsecure()]);
    $client = new ApplicationServiceClient('url', [], $channel);
    $request = new ListApplicationsRequest();
    $response = $client->List($request);
    $data = $response->wait();
    print_r($data);
}

main();