I am looking for some help with the AboutData::CreateFromXml function. HAE
added a field that has an a(uo) signature to the About Data, and I cannot get
this function to return correctly. Can you think of a way to fix this w/o
touching AboutData. I think I can make it skip any field w/o an "s" signature,
but I'd rather not be touching core, since I don't want the dependency on 16.4
in HAE.
Thanks,
Mike Finch
QStatus HaeAboutData::CreateFromXml(const qcc::String& aboutDataXml)
{
printf("Here in HAE qcc function\n");
return AboutData::CreateFromXml(aboutDataXml);
}
TEST(HaeAboutDataTest, CreateFromXml_from_qcc_string) {
QStatus status = ER_FAIL;
HaeAboutData aboutData;
qcc::String xml =
"<AboutData>"
" <AppId>000102030405060708090A0B0C0D0E0C</AppId>"
" <DefaultLanguage>en</DefaultLanguage>"
" <DeviceName>My Device Name</DeviceName>"
" <DeviceName lang = 'es'>Nombre de mi dispositivo</DeviceName>"
" <DeviceId>baddeviceid</DeviceId>"
" <AppName>My Application Name</AppName>"
" <AppName lang = 'es'>Mi Nombre de la aplicación</AppName>"
" <Manufacturer>Company</Manufacturer>"
" <Manufacturer lang = 'es'>Empresa</Manufacturer>"
" <ModelNumber>Wxfy388i</ModelNumber>"
" <Description>A detailed description provided by the
application.</Description>"
" <Description lang = 'es'>Una descripción detallada proporcionada por
la aplicación.</Description>"
" <DateOfManufacture>2014-01-08</DateOfManufacture>"
" <SoftwareVersion>1.0.0</SoftwareVersion>"
" <HardwareVersion>1.0.0</HardwareVersion>"
"
<SupportUrl>www.example.com<redir.aspx?REF=gRlp9p_gfZS-hln7EWyEtOH6jJBGyRPXyqd-fbhJwSFEnOhiHFTTCAFodHRwOi8vd3d3LmV4YW1wbGUuY29t></SupportUrl>"
" <UserDefinedTag>Can only accept strings anything other than strings
must be done using the AboutData Class SetField method</UserDefinedTag>"
" <UserDefinedTag lang='es'>Sólo se puede aceptar cadenas distintas de
cadenas nada debe hacerse utilizando el método AboutData Clase
SetField</UserDefinedTag>"
" <Location>upstairs bedroom</Location>"
" <Location lang='es'>habitación del segundo piso</Location>"
// "
<DeviceTypeDescription><Description><device_type>6</device_type><object_path>/Hae/Thermostat</object_path></Description></DeviceTypeDescription>"
"</AboutData>";
status = aboutData.CreateFromXml(xml);
EXPECT_EQ(ER_OK, status);
MsgArg aboutArg;
status = aboutData.GetAboutData(&aboutArg);
EXPECT_EQ(ER_OK, status);
printf("*****\n%s\n*****\n", aboutArg.ToString().c_str());
Outputs this:
*****
<invalid/>
*****
I am sure it is because we have a complex about field, because when I comment
out this line below it runs fine.
void HaeAboutData::InitializeCustomFieldDetails()
{
SetNewFieldDetails(HaeAboutKeys::COUNTRY_OF_PRODUCTION.c_str(),
LOCALIZED, "s");
SetNewFieldDetails(HaeAboutKeys::CORPORATE_BRAND.c_str(),
LOCALIZED, "s");
SetNewFieldDetails(HaeAboutKeys::PRODUCT_BRAND.c_str(),
LOCALIZED, "s");
SetNewFieldDetails(HaeAboutKeys::LOCATION.c_str(), REQUIRED
| LOCALIZED | ANNOUNCED, "s");
// SetNewFieldDetails(HaeAboutKeys::DEVICE_TYPE_DESCRIPTION.c_str(),
REQUIRED | ANNOUNCED, "a(uo)");
}
Thanks,
Mike
NOTICE: All information in and attached to the e-mails below may be
proprietary, confidential, privileged and otherwise protected from improper or
erroneous disclosure. If you are not the sender's intended recipient, you are
not authorized to intercept, read, print, retain, copy, forward, or disseminate
this message. If you have erroneously received this communication, please
notify the sender immediately by phone (704-758-1000<tel:%28704-758-1000>) or
by e-mail and destroy all copies of this message electronic, paper, or
otherwise.
By transmitting documents via this email: Users, Customers, Suppliers and
Vendors collectively acknowledge and agree the transmittal of information via
email is voluntary, is offered as a convenience, and is not a secured method of
communication; Not to transmit any payment information E.G. credit card, debit
card, checking account, wire transfer information, passwords, or sensitive and
personal information E.G. Driver's license, DOB, social security, or any other
information the user wishes to remain confidential; To transmit only
non-confidential information such as plans, pictures and drawings and to assume
all risk and liability for and indemnify Lowe's from any claims, losses or
damages that may arise from the transmittal of documents or including
non-confidential information in the body of an email transmittal. Thank you.
NOTICE: All information in and attached to the e-mails below may be
proprietary, confidential, privileged and otherwise protected from improper or
erroneous disclosure. If you are not the sender's intended recipient, you are
not authorized to intercept, read, print, retain, copy, forward, or disseminate
this message. If you have erroneously received this communication, please
notify the sender immediately by phone (704-758-1000) or by e-mail and destroy
all copies of this message electronic, paper, or otherwise.
By transmitting documents via this email: Users, Customers, Suppliers and
Vendors collectively acknowledge and agree the transmittal of information via
email is voluntary, is offered as a convenience, and is not a secured method of
communication; Not to transmit any payment information E.G. credit card, debit
card, checking account, wire transfer information, passwords, or sensitive and
personal information E.G. Driver's license, DOB, social security, or any other
information the user wishes to remain confidential; To transmit only
non-confidential information such as plans, pictures and drawings and to assume
all risk and liability for and indemnify Lowe's from any claims, losses or
damages that may arise from the transmittal of documents or including
non-confidential information in the body of an email transmittal. Thank you.
_______________________________________________
Allseen-core mailing list
[email protected]
https://lists.allseenalliance.org/mailman/listinfo/allseen-core