public function testPolishChar() { $pdu = new Submit(); $pdu->setAddress("+48660548430"); $pdu->setVp(3600 * 24 * 4); $pdu->setData("łóśćąę"); // łóśćąę $parts = $pdu->getParts(); $this->assertNotNull($parts); $this->assertCount(1, $parts); foreach ($parts as $part) { echo (string) $part . " == 07911356131313F301000B918466508434F000080C014200F3015B010701050119\n"; $this->assertTrue((string) $part == '0011000B918466508434F00008AA0C014200F3015B010701050119'); } }
public function sendPdu() { $pdu = new Submit(); $pdu->setAddress($this->argument('number')); $pdu->setData($this->argument('message')); $promises = []; foreach ($pdu->getParts() as $part) { $promises[] = $this->request('DongleSendPdu', ['Device' => $this->getDevice(), 'PDU' => (string) $part]); } $promise = \React\Promise\map($promises, function (Response $response) { Event::fire('ami.dongle.sms.sended', [$this, $response]); $message = Arr::get($response->getFields(), 'Message', null); $this->line($message); }); $promise->then([$this, 'stop'], [$this, 'writeException']); }