本文整理汇总了C++中APDU::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ APDU::Set方法的具体用法?C++ APDU::Set怎么用?C++ APDU::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APDU
的用法示例。
在下文中一共展示了APDU::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConfigureRequest
void TimeSync::ConfigureRequest(APDU& arAPDU)
{
if(mDelay < 0) {
arAPDU.Set(FC_DELAY_MEASURE);
mStart = mpTimeSrc->GetUTC();
}
else {
arAPDU.Set(FC_WRITE);
ObjectWriteIterator owi = arAPDU.WriteContiguous(Group50Var1::Inst(), 0, 0, QC_1B_CNT);
Group50Var1::Inst()->mTime.Set(*owi, mpTimeSrc->GetTimeStampUTC() + mDelay);
}
}
示例2: ConfigureRequest
void VtoTransmitTask::ConfigureRequest(APDU& arAPDU)
{
/*
* Masters never request confirmed data. The response from the
* slave is all that's required for reliable delivery.
*/
arAPDU.Set(mUseNonStandardCode ? FC_PROPRIETARY_VTO_TRANSFER : FC_WRITE);
const size_t MAX_VTO_EVENTS = 7;
/* Get all of the data objects in the buffer. */
size_t numObjects = this->mBuffer.Select(PC_ALL_EVENTS, MAX_VTO_EVENTS);
LOG_BLOCK(LEV_INTERPRET, "VtoTransmitTask Sending: " << numObjects << " of " << this->mBuffer.Size());
/* If there are no objects to write, skip the remainder. */
if (numObjects == 0) {
return;
}
/*
* Loop through the selected data and add corresponding objects to
* the arAPDU instance.
*/
VtoDataEventIter vto = this->mBuffer.Begin();
for (size_t i = 0; i < numObjects; ++i) {
/* Insert a new object into the APDU message. */
IndexedWriteIterator itr = arAPDU.WriteIndexed(
Group112Var0::Inst(),
vto->mValue.GetSize(),
vto->mIndex
);
/*
* Check to see if the APDU fragment has enough room for the
* data segment. If the fragment is full, return out of this
* function and let the fragment send.
*/
if (itr.IsEnd()) {
return;
}
/* Set the object index */
itr.SetIndex(vto->mIndex);
/* Write the data to the APDU message */
Group112Var0::Inst()->Write(
*itr,
vto->mValue.GetSize(),
vto->mValue.mpData
);
/* Mark the data segment as being written */
vto->mWritten = true;
/* Move to the next data segment in the buffer */
++vto;
}
}
示例3: ConfigureRequest
void ClassPoll::ConfigureRequest(APDU& arAPDU)
{
if (mClassMask == PC_INVALID) {
throw InvalidStateException(LOCATION, "Class mask has not been set");
}
arAPDU.Set(FC_READ);
if (mClassMask & PC_CLASS_0) arAPDU.DoPlaceholderWrite(Group60Var1::Inst());
if (mClassMask & PC_CLASS_1) arAPDU.DoPlaceholderWrite(Group60Var2::Inst());
if (mClassMask & PC_CLASS_2) arAPDU.DoPlaceholderWrite(Group60Var3::Inst());
if (mClassMask & PC_CLASS_3) arAPDU.DoPlaceholderWrite(Group60Var4::Inst());
}