More complete rework of packet parsing and packet generation with 29710c

This commit is contained in:
2024-05-19 23:28:45 +10:00
parent 46f52dd56d
commit f279d85b08
43 changed files with 412 additions and 291 deletions

View File

@@ -253,14 +253,18 @@ class System extends Model
* Return the packet that this system uses
*
* @param Address $ao
* @param string|null $password
* @return Packet
*/
public function packet(Address $ao): Packet
public function packet(Address $ao,string $password=NULL): Packet
{
// @todo Check that the address is one of the system's addresses
return (new (collect(Packet::PACKET_TYPES)
->get($this->pkt_type ?: config('fido.packet_default'))))->for($ao);
return
(new (collect(Packet::PACKET_TYPES)
->get($this->pkt_type ?: config('fido.packet_default'))))
->for($ao)
->password($password);
}
public function poll(): ?Job