Skip to content

A PHP implementation of the MSP (serial multiwii) protocol

License

Notifications You must be signed in to change notification settings

Volantus/msp-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSP Protocol in PHP

A PHP implementation of the MSP (serial multiwii) protocol

Usage

Complete device communication is handled by CommunicationService, which gets a SerialInterface injected.

    use Volantus\MSPProtocol\Src\Protocol\CommunicationService;
    use Volantus\MSPProtocol\Src\Protocol\Request\MotorStatus as MotorStatusRequest;
    use Volantus\MSPProtocol\Src\Protocol\Response\MotorStatus as MotorStatusResponse;
    use Volantus\MSPProtocol\Src\Serial\SerialInterface;
    
    $serialInterface = new SerialInterface('/dev/ttyUSB0', 115200);
    $service = new CommunicationService($serialInterface);
    
    /** @var MotorStatusResponse $response */
    $response = $service->send(new MotorStatusRequest());
    
    // Status of the first motor (Value between 1000 and 2000)
    $response->getStatuses()[0];

Requests/Response

The current request/response implementation set is not complete yet. Especially custom packages from Clean-/Betaflight are missing. Contributors are highly welcome.

All request and responses are encapsulated into objects, which includes interpretation logic about their respective payload structure.

  • Request namespace: Volantus\MSPProtocol\Src\Protocol\Request
  • Response namespace: Volantus\MSPProtocol\Src\Protocol\Response

For a complete list of available (orginal MultiWii) packages please consult the official documentation.

Contribution

Contributors a highly welcome. Please respect the following basic rules:

Code style

The project follows the ZEND code style with a extended flexible line size.

Tests

Please create/extend/modify unit and integration tests. System dependencies should always be mocked.

Workflow

  1. Fork the repository
  2. Create feature branch from master
  3. Create pull request

About

A PHP implementation of the MSP (serial multiwii) protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages