ctr_Repair/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.cpp
N2614 c35367985a BgsCommunicator:XMLデータ生成まで
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@566 385bec56-5757-e545-9c3a-d8741f4650f1
2012-01-18 07:03:27 +00:00

96 lines
2.7 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: BgsCommunicator.cpp
Copyright 2009-2011 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Rev$
*---------------------------------------------------------------------------*/
#include "BgsCommunicator.h"
#include <cstring>
#include <sstream>
namespace ConsoleRestore
{
namespace
{
const char xmlDataPrefix[] = \
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<SOAP-ENV:Envelope xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns0=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns2=\"urn:bgs.wsapi.broadon.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n\
<SOAP-ENV:Header/>\n\
<ns1:Body>\n\
<ns2:GetPreInstalledInfo>\n\
<ns2:GetPreInstalledInfo>\n\
<ns2:Version/>\n\
<ns2:MessageId/>\n";
const char xmlDeviceIdPrefix[] = \
" <ns2:DeviceId>";
const char xmlDeviceIdSuffix[] = "</ns2:DeviceId>\n";
const char xmlSerialNoPrefix[] = \
" <ns2:SerialNo>";
const char xmlSerialNoSuffix[] = "</ns2:SerialNo>\n";
const char xmlDataSuffix[] = \
" </ns2:GetPreInstalledInfo>\n\
</ns2:GetPreInstalledInfo>\n\
</ns1:Body>\n\
</SOAP-ENV:Envelope>";
}
BgsCommunicator::BgsCommunicator()
{
// TODO 自動生成されたコンストラクター・スタブ
}
BgsCommunicator::~BgsCommunicator()
{
// TODO Auto-generated destructor stub
}
void BgsCommunicator::CreateXml(bit64 deviceId, u8* serialNo)
{
m_Xml.append(xmlDataPrefix);
m_Xml.append(xmlDeviceIdPrefix);
std::ostringstream oss;
oss << std::dec;
oss << deviceId;
m_Xml.append(oss.str());
m_Xml.append(xmlDeviceIdSuffix);
m_Xml.append(xmlSerialNoPrefix);
m_Xml.append(reinterpret_cast<char*>(serialNo));
m_Xml.append(xmlSerialNoSuffix);
m_Xml.append(xmlDataSuffix);
}
std::string BgsCommunicator::GetXml()
{
return m_Xml;
}
bool BgsCommunicator::Execute()
{
}
size_t BgsCommunicator::GetBodySize()
{
}
void BgsCommunicator::GetBody(void *buf)
{
}
} /* namespace ConsoleRestore */