mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Adds timeout capabilities to blocking Rpc Calls (#86)
This commit is contained in:
committed by
Peter Johnson
parent
bc99d341fb
commit
0b80bd2b09
@@ -128,6 +128,10 @@ bool PollRpc(bool blocking, RpcCallInfo* call_info) {
|
||||
return RpcServer::GetInstance().PollRpc(blocking, call_info);
|
||||
}
|
||||
|
||||
bool PollRpc(bool blocking, double time_out, RpcCallInfo* call_info) {
|
||||
return RpcServer::GetInstance().PollRpc(blocking, time_out, call_info);
|
||||
}
|
||||
|
||||
void PostRpcResponse(unsigned int rpc_id, unsigned int call_uid,
|
||||
StringRef result) {
|
||||
RpcServer::GetInstance().PostRpcResponse(rpc_id, call_uid, result);
|
||||
@@ -141,6 +145,12 @@ bool GetRpcResult(bool blocking, unsigned int call_uid, std::string* result) {
|
||||
return Storage::GetInstance().GetRpcResult(blocking, call_uid, result);
|
||||
}
|
||||
|
||||
bool GetRpcResult(bool blocking, unsigned int call_uid,
|
||||
double time_out, std::string* result) {
|
||||
return Storage::GetInstance().GetRpcResult(blocking, call_uid, time_out,
|
||||
result);
|
||||
}
|
||||
|
||||
std::string PackRpcDefinition(const RpcDefinition& def) {
|
||||
WireEncoder enc(0x0300);
|
||||
enc.Write8(def.version);
|
||||
|
||||
Reference in New Issue
Block a user