Esempio n. 1
0
 protected function collectPayload()
 {
     $reader = new ReaderArray();
     $dsn = "dio.serial:///dev/ttyUSB2";
     $session = new Session($dsn);
     $command = new Command();
     $command->setSMSTextMode();
     $command->readSMS(ATCommandInterface::TYPE_ALL);
     $service = new Service($session, $command);
     $this->payload[self::DATA_INBOX] = $reader->get($service);
 }
Esempio n. 2
0
 public function testRead()
 {
     $reader = new ReaderArray();
     $this->assertInstanceOf('\\Pintu\\ReaderInterface', $reader);
     $dsn = "dio.serial:///dev/ttyUSB0";
     $session = new Session($dsn);
     $command = new Command();
     $command->setSMSTextMode();
     $command->readSMS(ATCommandInterface::TYPE_ALL);
     $service = new Service($session, $command);
     $this->assertTrue(is_array($reader->get($service)));
 }
Esempio n. 3
0
 public function testRunValidService()
 {
     $dsn = "dio.serial:///dev/ttyUSB0";
     $session = new Session($dsn);
     $command = new Command();
     $command->setSMSTextMode();
     $command->sendSMS('085648721439', 'Foo Bar');
     $command->readSMS(ATCommandInterface::TYPE_ALL);
     $service = new Service($session, $command);
     $this->assertInstanceOf('\\Pintu\\DIOServiceInterface', $service);
     $service->run();
 }