Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:bs2_partialupdateuserfaceex [2022/09/30 09:19] kkshin [Sample Code (C++)] |
en:bs2_partialupdateuserfaceex [2024/05/28 17:25] (current) kkshin |
||
---|---|---|---|
Line 34: | Line 34: | ||
|0x0200 |Jobcode | | |0x0200 |Jobcode | | ||
|0x0400 |Private Message | | |0x0400 |Private Message | | ||
- | |0x0800 |Face ''(FSF2, BS3)'' | | + | |0x0800 |Face ''(Visual Face Support)'' | |
- | |0x1000 |User setting ''(FSF2, BS3)'' | | + | |0x1000 |User setting ''(Visual Face Support)'' | |
</WRAP> | </WRAP> | ||
* [In] ''//userBlob//'' : Partial user information you want to update | * [In] ''//userBlob//'' : Partial user information you want to update | ||
Line 155: | Line 155: | ||
==== Sample Code (C#) ==== | ==== Sample Code (C#) ==== | ||
<file csharp sample_partialupdateuserfaceex.cs> | <file csharp sample_partialupdateuserfaceex.cs> | ||
- | BS2_USER_MASK mask = (BS2_USER_MASK)BS2UserMaskEnum.SETTING | (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX | (BS2_USER_MASK)BS2UserMaskEnum.JOB; | + | BS2_USER_MASK maskWantUpdate = (BS2_USER_MASK)BS2UserMaskEnum.SETTING | (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX | (BS2_USER_MASK)BS2UserMaskEnum.JOB; |
BS2ErrorCode sdkResult = BS2ErrorCode.BS_SDK_SUCCESS; | BS2ErrorCode sdkResult = BS2ErrorCode.BS_SDK_SUCCESS; | ||
Line 179: | Line 179: | ||
return; | return; | ||
- | if ((mask & (BS2_USER_MASK)BS2UserMaskEnum.SETTING) == (BS2_USER_MASK)BS2UserMaskEnum.SETTING) | + | if ((maskWantUpdate & (BS2_USER_MASK)BS2UserMaskEnum.SETTING) == (BS2_USER_MASK)BS2UserMaskEnum.SETTING) |
{ | { | ||
if (BS2ErrorCode.BS_SDK_SUCCESS != (sdkResult = getUserBlobExpiryDate(ref userBlob[0].setting))) | if (BS2ErrorCode.BS_SDK_SUCCESS != (sdkResult = getUserBlobExpiryDate(ref userBlob[0].setting))) | ||
Line 191: | Line 191: | ||
} | } | ||
- | if ((mask & (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX) == (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX) | + | if ((maskWantUpdate & (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX) == (BS2_USER_MASK)BS2UserMaskEnum.SETTING_EX) |
{ | { | ||
if (BS2ErrorCode.BS_SDK_SUCCESS != (sdkResult = getUserBlobPrivateAuthModeEx(ref userBlob[0].settingEx))) | if (BS2ErrorCode.BS_SDK_SUCCESS != (sdkResult = getUserBlobPrivateAuthModeEx(ref userBlob[0].settingEx))) | ||
Line 199: | Line 199: | ||
// ... | // ... | ||
- | if ((mask & (BS2_USER_MASK)BS2UserMaskEnum.JOB) == (BS2_USER_MASK)BS2UserMaskEnum.JOB) | + | if ((maskWantUpdate & (BS2_USER_MASK)BS2UserMaskEnum.JOB) == (BS2_USER_MASK)BS2UserMaskEnum.JOB) |
{ | { | ||
Console.WriteLine("Do you want to change/delete #{0} jobs? (0:Change, 1:Delete)", userID); | Console.WriteLine("Do you want to change/delete #{0} jobs? (0:Change, 1:Delete)", userID); | ||
Line 215: | Line 215: | ||
case 1: // Delete | case 1: // Delete | ||
default: | default: | ||
- | mask &= ~(BS2_USER_MASK)BS2UserMaskEnum.JOB; | + | maskWantUpdate &= ~(BS2_USER_MASK)BS2UserMaskEnum.JOB; |
break; | break; | ||
} | } | ||
Line 226: | Line 226: | ||
userBlob[0].user.numCards = 0; | userBlob[0].user.numCards = 0; | ||
- | if ((mask & (BS2_USER_MASK)BS2UserMaskEnum.CARD) == (BS2_USER_MASK)BS2UserMaskEnum.CARD) | + | if ((maskWantUpdate & (BS2_USER_MASK)BS2UserMaskEnum.CARD) == (BS2_USER_MASK)BS2UserMaskEnum.CARD) |
{ | { | ||
Console.WriteLine("Do you want to change/delete #{0} cards? (0:Change, 1:Delete)", userID); | Console.WriteLine("Do you want to change/delete #{0} cards? (0:Change, 1:Delete)", userID); | ||
Line 243: | Line 243: | ||
default: | default: | ||
// unmasking and numCards = 0; | // unmasking and numCards = 0; | ||
- | mask &= ~(BS2_USER_MASK)BS2UserMaskEnum.CARD; | + | maskWantUpdate &= ~(BS2_USER_MASK)BS2UserMaskEnum.CARD; |
break; | break; | ||
} | } | ||
Line 255: | Line 255: | ||
// ... | // ... | ||
- | sdkResult = (BS2ErrorCode)API.BS2_PartialUpdateUserFaceEx(sdkContext, deviceID, mask, userBlob, (UInt32)numOfUser); | + | sdkResult = (BS2ErrorCode)API.BS2_PartialUpdateUserFaceEx(sdkContext, deviceID, maskWantUpdate, userBlob, (UInt32)numOfUser); |
if (BS2ErrorCode.BS_SDK_SUCCESS != sdkResult) | if (BS2ErrorCode.BS_SDK_SUCCESS != sdkResult) | ||
Console.WriteLine("BS2_PartialUpdateUserFaceEx call failed {0}", sdkResult); | Console.WriteLine("BS2_PartialUpdateUserFaceEx call failed {0}", sdkResult); | ||
</file> | </file> | ||