Tuesday, August 31, 2004

HTTP v1.1 : I have added support for HTTP v1.1 to the HTTP server of CyberLink. I have added the many changes, and I have passed the existing test cases of CPPUnit and JUnit. I have to add the new test cases, but the following is the implementation for HEAD and CONTENT-RANGE request.
boolean HTTPSocket::post(HTTPResponse httpRes, byte content[], long contentOffset, long contentLength, boolean isOnlyHeader)

{
httpRes.setDate(Calendar.getInstance());
OutputStream out = getOutputStream();
try {
out.write(httpRes.getHeader().getBytes());
out.write(HTTP.CRLF.getBytes());
if (isOnlyHeader == true) {
out.flush();
return true;
}
out.write(content, (int)contentOffset, (int)contentLength);
out.flush();
}
catch (Exception e) {
//Debug.warning(e);
return false;
}
return true;
}

boolean HTTPRequest::post(HTTPResponse httpRes)
{
HTTPSocket httpSock = getSocket();
long offset = 0;
long length = httpRes.getContentLength();
if (hasContentRange() == true) {
long firstPos = getContentRangeFirstPosition();
long lastPos = getContentRangeLastPosition();
offset = firstPos;
length = lastPos - firstPos + 1;
}
httpSock.post(httpRes, offset, length, isHeadRequest());
//httpSock.close();
}

Thursday, August 26, 2004

HAI Home Control for Windows Media Center : HAI released the plugin for Windows Media Center to control their home home control devices such as OmniProII. I would like to create the control device myself, and implement the UPnP service such as Lighting Controls V1.0 into the device.

PLC in Japan : Japanese government had been stopped the field test for PLC from two years ago because the electric wave was leaked to other bands. However they approved the field test again from this month after changing some laws for the electric wave. Immediately, NTT-AT starts the field test. I hope Japanese government will approve PLC as soon as possible for home automation control.

Wednesday, August 25, 2004

VAIO Media : I am checking the UPnP AV client with CyberMediaGate for MythTV. Basically, the client uses only browse action, but It seems that the client use the following extended action, X_GetSchema, to get the thumbnail image.
POST /service/ContentDirectory_control HTTP/1.1

HOST: 192.168.1.20:38521
CONTENT-LENGTH: 410
CONTENT-TYPE: text/xml; charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#X_GetSchema"
X-AV-Client-Info: av=2.0;hn="YOUR-VJXTZQOWMX";cn="Sony Corporation";mn="VAIO Media";mv="2.6.00"
X-AV-Physical-Unit-Info: pa="YOUR-VJXTZQOWMX";

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_GetSchema xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ClassName>object.container</ClassName>
<Filter>dc:title,dc:date,upnp:channelName,upnp:genre,res@duration,</Filter>
</u:X_GetSchema>
</s:Body>
</s:Envelope>
Next, the client wants to get the movie stream using HTTP as follows, but the client will be hang up or aborted. I guess that the media server have to support the extended tag, X-Seek-Range, like CONTENT-RANGE of HTTP to get the stream.
GET /ExportContent?id=3 HTTP/1.1

Host: 192.168.1.20:38520
Connection: close
X-Seek-Range: npt=0:0:0.0-
X-AV-Client-Info: av=2.0;hn="YOUR-VJXTZQOWMX";cn="Sony Corporation";mn="VAIO Media";mv="2.6.00"
X-AV-Physical-Unit-Info: pa="YOUR-VJXTZQOWMX";
id = 3
itemNode = 0x938bdd8
contentLen = 1751496640
contentTypeIn = video/mpeg
contentIn = 0xbc30d008

Monday, August 23, 2004

Blogger API 1.0 : I checked the XML-RPC based API, but it seems that the contents can't be extracted using the API.

CyberLink for Java : I have added a interface for the search capability as follows.
public interface SearchCap

{
public String getPropertyName();
public boolean compare(SearchCriteria searchCri, ContentNode conNode);
}
I am creating the search plug-in as follows. The Java code is no problem because the String class uses Unicode. However I have to add some changes for the C++ version to use local code or Unicode in all the C++ code.
public class TitleSearchCap implements SearchCap 

{
public TitleSearchCap()
{
}
public String getPropertyName()
{
return SearchCriteria.TITLE;
}
public boolean compare(SearchCriteria searchCri, ContentNode conNode)
{
String searchCriTitle = searchCri.getValue();
String conTitle = conNode.getTitle();
if (searchCriTitle == null|| conTitle == null)
return false;
int cmpRet = conTitle.compareTo(searchCriTitle);
if (cmpRet == 0 && (searchCri.isEQ() || searchCri.isLE() || searchCri.isGE()))
return true;
else if (cmpRet < 0 && searchCri.isLT())
return true;
else if (0 < cmpRet && searchCri.isGT())
return true;
int idxRet = conTitle.indexOf(searchCriTitle);
if (0 <= idxRet && searchCri.isContains())
return true;
else if (searchCri.isDoesNotContain())
return true;
return false;
}
}

Sunday, August 22, 2004

Xcode 1.5 : I compiled existing Xcode projects such as CyberLink, but the following errors occurred.
gcc-3.3: CyberLink_Prefix.pch: No such file or directory

gcc-3.3: warning: `-x c++-header' after last input file has no effect
gcc-3.3: no input files
gcc-3.3: CyberLink_Prefix.pch: No such file or directory
gcc-3.3: warning: `-x c++-header' after last input file has no effect
gcc-3.3: no input files
I checked the release notes of Xcode v1.5, and I find out the following change about the precompiled header
gcc 3.3 is the default compiler. gcc 3.3 offers the following advantages over gcc 3.1:

Support for optimized code generation for the new PowerPC G5 processor
Support for stub libraries
Many performance optimizations
A new precompiled header mechanism (PCH) that works for C, Objective-C, C++, and Objective-C++
Then, I added the following precompiled header to refer a new project that was created using Xcode v1.5, and I could compile the projects with no problem.
//

// Prefix header for all source files of the 'CyberLink' target in the 'CyberLink' project
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

Friday, August 20, 2004

CodingGuidelines : I read the coding guideline for Cocoa. I realized again not to use abbreviate and ambiguity names fot the method and variable.

Cocoa Objective-C Language Sample Code : I am cheking how to use C++ classes with Cocoa using the sample, Cocoa_With_Carbon_or_CPP. I knew that I can put C++ codes directly in Objective-C methods because the Objective-C++ compiler can understand both C++ and Objective-C codes as follows.
- (void)message2:(id)sender

{
int howMany;
NSString *theAnswer;
Foo *myCPlusPlusObj; //A C++ object
//Create and use a new C++ object
myCPlusPlusObj=new Foo();
howMany=myCPlusPlusObj->getVariable();
delete myCPlusPlusObj;
//Here we put together an NSString that contains the value returned by fooGetVariable()
theAnswer=[NSString stringWithFormat:@"Hello, World! When our C++ object is queried, it tells us that the number is %i!",howMany];
//Display an alert message on the screen with the string generated above
NSRunAlertPanel(@"C++ from Obj-C",theAnswer,@"OK",NULL,NULL);
}

Thursday, August 19, 2004

Xcode v1.5 : I have installed the latest development tools for MacOSX. I would like to study Cocoa based application using Objective-C because I have only old programming knowledge about MacOS using C and C++ like Carbon.

WH-R540 I wanted to order the repair parts for the spokes of the rear wheel, but the parts were out of stock of this year.

RD-6500-SS : I wanted to buy RD-7700-SS because the rear derailleur has some damages, but the parts was out of stock too. Then, I could buy only a cheap derailleur, RD-4400-SS, changed to the new derailleur with the shift cable. It is slow and rough but correct shift than the broken derailleur.

Tuesday, August 17, 2004

I went back to my hometown and was staying at the hot spring, Hanamaki and Higasine, among the summer vacation.

AirTune : The crypt stream is analized by Jon Lech Johansen. The stream is encrypted with AES and the AES key is encrypted with RSA. He released JustePot that could stream MPEG4 Apple Lossless files to an AirPort Express. The public key is bellow.
AirPort Express RSA Public Key, Modulus:

59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUtwC
5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDR
KSKv6kDqnw4UwPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuB
OitnZ/bDzPHrTOZz0Dew0uowxf/+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJ
Q+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/UAaHqn9JdsBWLUEpVviYnh
imNVvYFZeCXg/IdTQ+x4IRdiXNv5hEew==
Exponent: AQAB


Wednesday, August 11, 2004

I have relased new packages of CyberLink for C++ and Java today. I have added some supports for Intel NMPR. The major changes are bellow. Please check the programming guide about the implementation in more detail.

CyberLink for C++ v1.5 :
* Added Device::setNMPRMode() and isNMPRMode().

* Changed to advertise every 25%-50% of the periodic notification cycle for NMPR.
* Added Device::setWirelessMode() and isWirelessMode().
* Changed Device::start() to send a bye-bye before the announce for NMPR.
* Changed Device::annouce(), byebye() and deviceSearchReceived() to send the SSDP messsage four times when the NMPR and the Wireless mode are true.
* Fixed Device::announce() and byebye() to send the upnp::rootdevice message despite embedded devices.
* Fixed Device::getRootNode() to return the root node when the device is embedded.
* Fixed Service::announce() to set the root device URL to the LOCATION field.
* Added ControlPoint::renewSubscriberService().
* Changed ControlPoint::start() to create renew subscriber thread when the NMPR mode is true.
* Changed Action::postControlAction() to set the status code to the UPnPStatus.
* Changed StateVariable::postQuerylAction() to set the status code to the UPnPStatus.
* Added Device::getParentDevice();
* Changed Service::notify() to remove the expired subscribers and not to remove the invalid response subscribers for NMPR.
CyberLink for Java v1.5 :
* Added Device::setNMPRMode() and isNMPRMode().

* Changed to advertise every 25%-50% of the periodic notification cycle for NMPR.
* Added Device::setWirelessMode() and isWirelessMode().
* Changed Device::start() to send a bye-bye before the announce for NMPR.
* Changed Device::annouce(), byebye() and deviceSearchReceived() to send the SSDP messsage four times when the NMPR and the Wireless mode are true.
* Fixed Device::announce() and byebye() to send the upnp::rootdevice message despite embedded devices.
* Fixed getRootNode() to return the root node when the device is embedded.
* Fixed Service::announce() to set the root device URL to the LOCATION field.
* Added ControlPoint::renewSubscriberService().
* Changed ControlPoint::start() to create renew subscriber thread when the NMPR mode is true.
* Changed Action::postControlAction() to set the status code to the UPnPStatus.
* Changed StateVariable::postQuerylAction() to set the status code to the UPnPStatus.
* Added Device::getParentDevice();
* Changed Service::notify() to remove the expired subscribers and not to remove the invalid response subscribers for NMPR.

2200BG : I bought the wireless network card for Mini-PCI at Akihabara yesterday. I could install the Mini-PCI card to VAIO note GR using the latest driver, but the note book has no inernal wireless antenna. I wonder if that I should create the antenna myself.

I am creating some documentation for CyberLink C++ and Java to release the new package as v1.5. I have uploaded the new package with the documentation to SourceFoge, I will release it tomorrow.

Doxygen : I have created a programmer's document of CyberLink for C++ using the documentation tool with the following options.
PROJECT_NAME           = "CyberLink for C++"

PROJECT_NUMBER = v1.5
OUTPUT_DIRECTORY = clinkccdoxygen
TAB_SIZE = 4
EXTRACT_ALL = YES
INPUT = ~skonno/src/CyberLink/include
FILE_PATTERNS = *.h
RECURSIVE = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO

Javadoc : I have created a programmer's document of CyberLink for Java using the documentation tool with the following script.
#!/bin/bash

ver=$1
mkdir clinkjavadoc$ver
mkdir clinkjavadoc$ver/src
cp -r http/org clinkjavadoc$ver/src
cp -r soap/org clinkjavadoc$ver/src
cp -r upnp/org clinkjavadoc$ver/src
cp -r util/org clinkjavadoc$ver/src
cp -r xml/org clinkjavadoc$ver/src
cp -r net/org clinkjavadoc$ver/src
javadoc
-d clinkjavadoc$ver
-sourcepath clinkjavadoc$ver/src
-verbose
-public
-windowtitle "CyberLink for Java v$ver"
-doctitle "CyberLink for Java v$ver"
-header "CyberLink for Java v$ver"
org.cybergarage.http
org.cybergarage.soap
org.cybergarage.upnp
org.cybergarage.upnp.control
org.cybergarage.upnp.device
org.cybergarage.upnp.event
org.cybergarage.upnp.ssdp
org.cybergarage.upnp.xml
org.cybergarage.util
org.cybergarage.xml
org.cybergarage.xml.parser
org.cybergarage.net
rm -rf clinkjavadoc$ver/src
jar cvfM clinkjavadoc$ver.zip clinkjavadoc$ver
rm -rf clinkjavadoc$ver

Tuesday, August 10, 2004

UPnP Media Server : I am implementing the search action as follows. The following code doesn't support the priority logical operation using the brackets, but I could check Sony's UPnP AV player, TA-LV700R, with the search function.
bool SearchCriteriaList::compare(ContentNode *cnode, SearchCapList *searchCapList)

{
int n;
int searchCriCnt = size();
// Set compare result
for (n=0; n<searchCriCnt; n++) {
SearchCriteria *searchCri = getSearchCriteria(n);
const char *property = searchCri->getProperty();
SearchCap *searchCap = searchCapList->getSearchCap(property);
if (searchCap == NULL) {
searchCri->setResult(true);
continue;
}
bool cmpResult = searchCap->compare(searchCri, cnode);
searchCri->setResult(cmpResult);
}
// Eval only logical ADD operation at first;
SearchCriteriaList orSearchCriList;
for (n=0; n<searchCriCnt; n++) {
SearchCriteria *currSearchCri = getSearchCriteria(n);
if (n<(searchCriCnt-1)) {
if (currSearchCri->isLogicalAND() == true) {
SearchCriteria *nextSearchCri = getSearchCriteria(n+1);
bool currResult = currSearchCri->getResult();
bool nextResult = nextSearchCri->getResult();
bool logicalAND = (currResult & nextResult) ? true : false;
nextSearchCri->setResult(logicalAND);
continue;
}
}
SearchCriteria *orSearchCri = new SearchCriteria(currSearchCri);
orSearchCriList.add(orSearchCri);
}
// Eval logical OR operation;
int orSearchCriCnt = orSearchCriList.size();
for (n=0; n<orSearchCriCnt; n++) {
SearchCriteria *searchCri = getSearchCriteria(n);
if (searchCri->getResult() == true)
return true;
}
return false;
}

TA-LV700R : I checked the search function with the UPnP Media Player and the UPnP Media Server for MythTV using the code. At first, the player couldn't read the stream, but I could fix the problem to changed the mime type for the protocolInfo from */* to video/mpeg as follows. I can see the movie contents in the MythTV using the UPnP Media Player now :-)
POST /service/ContentDirectory_control HTTP/HTTP/1.1

HOST: 192.168.1.20:38520
CONTENT-LENGTH: 2007
CONTENT-TYPE: text/xml
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Search"
X-AV-Client-Info: av = 2.0; cn = "Sony Corporation" ; mn = "RoomLink" ; mv = 1.0

<?xml version="1.0"?>
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Search xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ContainerID>0</ContainerID>
<SearchCriteria>
@id = "2" and
av:filmrollURI@av:codec = "CLUT8" and
av:filmrollURI@av:resolution = "80x60" and
av:filmrollURI@av:clutIndexOffset = "16" and
av:filmrollURI@av:clutNumIndex = "240" and
av:filmrollURI@av:clutData = "YrfiFLwDu.......7u4AddMMA"
</SearchCriteria>
<Filter>*</Filter>
<StartingIndex>0</StartingIndex>
<RequestedCount>1</RequestedCount>
<SortCriteria></SortCriteria>
</u:Search>
</s:Body>
</s:Envelope>

HTTP/1.0 200 OK
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER: Linux/2.4.22-1.2197.nptl UPnP/1.0 CyberLink/1.4.2
EXT:
CONTENT-LENGTH: 1391

<?xml version="1.0" encoding="......" s:encodingStyle="......">
<s:Body>
<u:SearchResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<Result>
<?xml version="1.0" encoding="utf-8"?>
<DIDL-Lite id="0" parentID="-1" restricted="1" xmlns="urn.....">
<item id="2" parentID="1" restricted="1">
<upnp:storageMedium>UNKNOWN</upnp:storageMedium>
<upnp:writeStatus>UNKNOWN</upnp:writeStatus>
<dc:title>xxxxxxxxxxxxxxxxxxxxxxx</dc:title>
<dc:creator></dc:creator>
<upnp:class>object.item.videoItem.movie</upnp:class>
<dc:date>2004-07-24</dc:date>
<upnp:storageUsed>1750337472</upnp:storageUsed>
<res protocolInfo="http-get:*:video/mpeg:*">http://192.168.x.xx:38520/ExportContent?id=2</res>
</item>
</DIDL-Lite>
</Result>
<NumberReturned>1</NumberReturned>
<TotalMatches>1</TotalMatches>
<UpdateID>2</UpdateID>
</u:SearchResponse>
</s:Body>
</s:Envelope>

Sunday, August 08, 2004

WH-R540 : I recently ride on a bicycle based on Panasonic's frame, but the spokes of the rear wheel was broken due to conflict with the rear derailleur. I changed to the other rear wheel, CXP30, but the rear derailleur has some damages. Two weeks ago, a spring bolt of the front derailleur was missed, FD-6500, I had to change to the new derailleur, FD-7700. I will order the repair parts, but I almost haven't check for past several months. I have to maintain more frequently.

I have read a programming book for H8 micro computer. I would like to implement more small protocol stack for UPnP for my home automation using the tiny computer such as AKI-H8/3069F if I have more time. According to Fenrir's BLog, C++ compiler of GNU could be used on the H8 boards. However, the CyberLink for C++ is a heavy implementation, I might have to implement more small using only C.

Friday, August 06, 2004

Simens UPnP SDK : The active user of CyberLink for Java, Stefano Lenzi, told me that the CyberLink couldn't send the action request normally because the sample device, binaryLight, has the following complex URLBase and controlURLs.
<URLBase>http://<ip>/<path1>/</URLBase>

<controlURL>/<path1>/<path2></URLBase>
Then, I checked the problem using Siemens Java SDK v1.01 for UPnP. However, It seems that the latest version has no URLBase. I knew that Intel's NMPR recommends the URLBase is blank. The Simens UPnP SDK might be changed for the NMPR.

UPnP Media Server : I checked the standard specification to implement the Search request. The SearchCriteria string syntax of the request is described using EBNF as follows. It is a bit hard to implement the action completly. I have to consider the good implementation.
searchCrit ::= searchExp | asterisk

searchExp ::= relExp | searchExp wChar+ logOp wChar+ searchExp |"(" wChar* searchExp wChar* ")"
logOp ::= "and" | "or"
relExp ::= property wChar+ binOp wChar+ quotedVal | property wChar+ existsOp wChar+ boolVal
binOp ::= relOp | stringOp
relOp ::= "=" | "!=" | "<" | "<=" | ">" | ">="
stringOp ::= "contains" | "doesNotContain" | "derivedfrom"
existsOp ::= "exists"
boolVal ::= "true" | "false"
quotedVal ::= dQuote escapedQuote dQuote
wChar ::= space | hTab | lineFeed | vTab | formFeed | return
property ::= (* property name as defined in section 2.4 *)
escapedQuote ::= (* double-quote escaped string as defined in section
hTab ::= (* UTF-8 code 0x09, horizontal tab character
lineFeed ::= (* UTF-8 code 0x0A, line feed character *)
vTab ::= (* UTF-8 code 0x0B, vertical tab character *)
formFeed ::= (* UTF-8 code 0x0C, form feed character *)
return ::= (* UTF-8 code 0x0D, carriage return character
space ::= " " (* UTF-8 code 0x20, space character *)
dQuote ::= """ (* UTF-8 code 0x22, double quote character *)
asterisk ::= "*" (* UTF-8 code 0x2A, asterisk character *)

Wednesday, August 04, 2004

Digital Audio Access Protocol : I am studying the protocol for iTunes using the following site. I couldn't find the technical documents from Apple's site, but I knew that iTunes finds the server using Rendezvous and the server is implemented using HTTP simply.
http://tapjam.net/daap/

http://daap.sourceforge.net/
mt-daapd : I have installed the DAAP server into KURO-BOX to refer iTunes Server for Linux and KURO-BOX Users BBS as follows.
Howl : http://www.porchdogsoft.com/products/howl/

>tar xvfz howl-0.9.6.tar.gz
>cd howl-0.9.6/
>./configure
>make
>make install

libid3tag : http://www.underbit.com/products/mad/
>apt-get install zlib zlib-devel
>tar xvfz libid3tag-0.15.1b.tar.gz
>cd libid3tag-0.15.1b/
>./configure
>make
>make install

mt-daapd : http://mt-daapd.sourceforge.net/
>apt-get install gdbm gdbm-devel
>tar xvfz mt-daapd-0.2.0.tar.gz
>cd mt-daapd-0.2.0/
>./configure
>make
>make install
>ldconfig
>cp contrib/mt-daapd.conf /etc
>mkdir /mnt/mp3
>mt-daapd
>tail /var/log/messages
mt-daapd[19741]: Starting rendezvous daemon
mt-daapd[19741]: Could not open songs database (/var/cache/mt-daapd/songs.gdb)
mt-daapd[19741]: Aborting
mt-daapd[19742]: Rendezvous pipe closed... Exiting
mt-daapd[19742]: Aborting
>killall mt-daapd
>mkdir /var/cache/mt-daapd
>mt-daapd
>tail /var/log/messages
mt-daapd[19748]: Starting rendezvous daemon
mt-daapd[19748]: Starting signal handler
mt-daapd[19748]: Loading playlists
mt-daapd[19748]: Initializing database
mt-daapd[19752]: Starting mp3 scan
mt-daapd[19769]: Starting web server from /usr/share/mt-daapd on port 3689
mt-daapd[19769]: Registering rendezvous names
mt-daapd[19769]: Scanned 0 songs in 0 seconds
>cp contrib/mt-daapd /etc/init.d/
>vi /etc/init.d/mt-daapd
start() {
echo -n $"Starting DAAP server: "
#set the full path to the installed mt-daapd
daemon /usr/local/sbin/mt-daapd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mt-daapd
}
stop() {
echo -n $"Shutting down DAAP server: "
#use killproc instead of killall
#killall -INT mt-daapd
killproc mt-daapd
RETVAL=$?

echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mt-daapd
}
>/etc/init.d/mt-daapd restat
Shutting down DAAP server: [ OK ]
Starting DAAP server: [ OK ]
>chkconfig --level 345 mt-daapd on
>chkconfig --list
mt-daapd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

Tuesday, August 03, 2004

TA-LV700R : I am checking the UPnP AV media player using my implemented UPnP Media Server, CyberMediaGate for MythTV. The player cound find the media server and get the content list normally, but it couldn't play the recorded MPEG2 contents with the following error messages.
playing error.

Reading of a video capsule went wrong.
I checked the log of the CyberMediaGate, I knew that the error message occurred because of lacking the search request as follows. I have not implemented the search function yet. I will support the function soon.
POST /service/ContentDirectory_control HTTP/HTTP/1.1

HOST: 192.168.1.20:38520
CONTENT-LENGTH: 2007
CONTENT-TYPE: text/xml
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Search"
X-AV-Client-Info: av = 2.0; cn = "Sony Corporation" ; mn = "RoomLink" ; mv = 1.0

<?xml version="1.0"?>
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Search xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ContainerID>0</ContainerID>
<SearchCriteria>
@id = "2" and av:filmrollURI@av:codec = "CLUT8" and
av:filmrollURI@av:resolution = "80x60" and
av:filmrollURI@av:clutIndexOffset = "16" and
av:filmrollURI@av:clutNumIndex = "240" and
av:filmrollURI@av:clutData = "YrfiAFWLpwDu7u4A3d3dAM ..... QBEVGQATYK4ACQ8RwBFWW4A"
</SearchCriteria>
<Filter>*</Filter>
<StartingIndex>0</StartingIndex>
<RequestedCount>1</RequestedCount>
<SortCriteria></SortCriteria>
</u:Search>
</s:Body>
</s:Envelope>

HTTP/1.0 500 Internal Server Error
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER: Linux/2.4.22-1.2197.nptl UPnP/1.0 CyberLink/1.4.2
EXT:
CONTENT-LENGTH: 487

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>401</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

Monday, August 02, 2004

RD-XS53/XS43 : Some Japanese developers are analyzing the recorders to get the recorded MPEG files to PC. It seems that the recorders use NetBIOS to find other recorders to transport the recorded files, and the transfer is executed using FTP. I like the recorders because it has two tuner board and a connector for satellite broadcasting devices. I might buy the recorders if Toshiba will support UPnP AV.

KURO-BOX : To compile CyberLink for C++, I changed the Vector::get() not to use stl::vector::at() as the following because the old gcc compiler, v2.95.3, doesn't support the method. I had to add some headers such as <stdio.h> and <typeinfo> to compile normally.
void *Vector::get(int index)

{
if (index < 0)
return NULL;
if ((int)size() < (index+1))
return NULL;
//return (void *)at(index);
return (void *)((*this)[index]);
}
net-tools : The Linux box has no <ifaddrs.h> to get the local host interfaces. Then, I have to create the same function using ioctl based on the ifconfig source codes as the following. The latest package, v1.60, uses some GNU original functions such as getdelim(), and I checked the v1.46.
static const char *PATH_PROC_NET_DEV = "/proc/net/dev";


int CyberNet::GetHostAddresses(NetworkInterfaceList &netfiList)
{
netfiList.clear();
int s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0)
return 0;
FILE *fd = fopen(PATH_PROC_NET_DEV, "r");
char buffer[256+1];
fgets(buffer, sizeof(buffer)-1, fd);
fgets(buffer, sizeof(buffer)-1, fd);
while (!feof(fd)) {
char *ifname = buffer;
char *sep;
if (fgets(buffer, sizeof(buffer)-1, fd) == NULL)
break;
sep = strrchr(buffer, ':');
if (sep)
*sep = 0;
while (*ifname == ' ')
ifname++;
struct ifreq req;
strcpy(req.ifr_name, ifname);
if (ioctl(s, SIOCGIFFLAGS, &req) < 0)
continue;
if (!(req.ifr_flags & IFF_UP))
continue;
if (req.ifr_flags & IFF_LOOPBACK)
continue;
if (ioctl(s, SIOCGIFADDR, &req) < 0)
continue;
char ifaddr[20+1];
strncpy(ifaddr, inet_ntoa(((struct sockaddr_in*)&req.ifr_addr)->sin_addr), sizeof(ifaddr)-1);
NetworkInterface *netIf = new NetworkInterface(ifaddr, ifname, 0);
netfiList.add(netIf);
}
fclose(fd);
close(s);
return netfiList.size();
}

Sunday, August 01, 2004

GV-MVP/RX : To install the ivtv driver by Kogi Kobayashi on FedoraCore1, I upgrade the kernel to kernel-2.4.22-1.2197. Then I installed MythTV v0.15.1, I could capture Japanese broad cast programs with no problem. I installed CyberLink for C++ too, and I could see the recorded movies of the MythTV using my customized VideoLAN client for UPnP AV :-)

mAgicTV Server : It is a multi channel video server for GV-MVP/RX on Windows. According to Kogi Kobayashi, it is easy to use the multiple capture board on Linux. I would like to use two capture board for MythTV like Cocoon at least.

WTK1811W : I changed the switch in my entrance room to light automatically. It was far to turn off the old switch from near the door.

This page is powered by Blogger. Isn't yours?