A PHP implementation of the MSP (serial multiwii) protocol
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];
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.
Contributors a highly welcome. Please respect the following basic rules:
The project follows the ZEND code style with a extended flexible line size.
Please create/extend/modify unit and integration tests. System dependencies should always be mocked.
- Fork the repository
- Create feature branch from master
- Create pull request