Monthly Archives: July 2009

PSP Programming Basics

As a C++ programmer i want to get my hands dirty with C programming. I was amazed to use my PSP as a multipurpose device for entertainment and knowledge base. I often load How to movies from Microsoft site and watch them whenever i get free time. Also play some games especially action & adventure.

I was wondering whether there is any SDK for PSP to program. So i started googling for the ways to do the program for PSP. The first google result for PSP programming gives me this url http://www.psp-programming.com/tutorials/. So i started setting up the dev environment. I followed the tutorial to install the CYGWIN for windows. I installed the CYGWIN and configured the PSP environment. I wrote main.c for hello world program. I ran the make command it gave me so many errors. Could not recognize the psp-config. I tried running the ./toolchain.sh script again for CYGWIN. It didn’t work for me. I tried changing the login script for the pspdev path. Still it didn’t work for the makefile. I could not compile the file. So i gave up this method. So started to google again for the PSP programming.

I came across this site http://ps2dev.org/ where they discuss about PSP SDK!!!! wow that’s what i need. I started reading the wiki site for PSP programming http://en.wikibooks.org/wiki/PSP_Programming/MinPSPW. The below site gives the steps to do http://www.instructables.com/id/Getting-started-On-programming-on-the-PSP-And-Comp/. You can even set up to configure with VS 2008 http://www.jetcube.eu/archives/2008/02/entry_74.html.

So everything is set. I started writing main.c for PSP using the textpad. I complied the program using make command hurray it works. It created the EBOOT.PBP file successfully. I deployed the file to psp it works. wow i become a psp developer. http://en.wikibooks.org/wiki/PSP_Programming/General/Common_Callback describes much about basic psp programming. I created a program to get the button input for psp it works. When we install the PSP SDK there are many sample programs installed with it. I am trying out one by one. Hope to write some useful utility for PSP atleast for me to use.

Windows Mobile Client for TFS WebService

I am so curious to write some windows mobile application for my HTC mobile. Recently i attended the TFS server 2008 training conducted by Microsoft at NTUC building. Once i finish the training i was eager to know whether any Mobile Application to update my task easily. I was searching for Internet but could not find any Mobile application which does that. So it had initiated me to try my own Windows Mobile application for TFS.

Once i decided to write the Mobile Application i need to decide either to use TFS SDK or the webservice. Of course WebService is the light weight approach for a Mobile application because i don’t have to add any reference to any assembly. Only web reference needs to be created which creates only the Proxy classes.

TFS Server has several webservice to manage the WorkItem tracking. Below are the services

http://localhost:8080/WorkItemTracking/v1.0/ClientService.asmx

http://localhost:8080/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx

http://localhost:8080/WorkItemTracking/v1.0/ExternalServices.asmx

http://localhost:8080/WorkItemTracking/v1.0/Integration.asmx

http://localhost:8080/WorkItemTracking/v1.0/SyncEventsListener.asmx

Before starting the Windows Mobile Application we need to identify the platform to develop the application. So i read the below documentation to install the Development tools. http://msdn.microsoft.com/en-us/library/bb158496.aspx. My HTC mobile has Windows Mobile 6.5 professional edition. So i had to download the WM 6.0 emulator for VS 2008. http://www.microsoft.com/downloads/details.aspx?FamilyID=06111a3a-a651-4745-88ef-3d48091a390b&DisplayLang=en. I downloaded the SDK for WM 6.0 for VS 2008.

I installed the SDK and started creating the WM application.

image

image

I added a webservice reference to the http://localhost:8080/WorkItemTracking/v1.0/ClientService.asmx through VS 2008.

image

I designed the form for my mobile to connect to the TFS server.

image

I manage to write a code to consume the webservice for the TFS server. I added the below code to consume the service.

            Dim myTfsClient As TFS.ClientService = New TFS.ClientService()
            myTfsClient.Url = txtURL.Text
            Dim mySortOrderEntry As TFS.QuerySortOrderEntry = New TFS.QuerySortOrderEntry()
            mySortOrderEntry.Ascending = True
            mySortOrderEntry.ColumnName = "WorkItem"
            Dim sort(1) As TFS.QuerySortOrderEntry
            sort(0) = mySortOrderEntry
            Dim metaTableEntry As TFS.MetadataTableHaveEntry = New TFS.MetadataTableHaveEntry
            Dim metaDataHave(1) As TFS.MetadataTableHaveEntry
            metaDataHave(0) = metaTableEntry
            Dim asOfDate As DateTime = DateTime.Now
            Dim dbStamp As String = ""
            Dim metaData As DataSet = New DataSet("metadata")
            Dim myQuery As Xml.XmlDocument = New Xml.XmlDocument()
            myQuery.LoadXml("<?xml version=’1.0′ encoding=’utf-8′?><WorkItemQuery Version=’1′><TeamFoundationServer>http://senwin2003:8080/</TeamFoundationServer><TeamProject>Sample</TeamProject><Wiql>SELECT [System.Id], [System.WorkItemType], [System.State], [System.AssignedTo], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.WorkItemType], [System.Id]</Wiql></WorkItemQuery>")
            Dim xmlNode As Xml.XmlElement
            xmlNode = myQuery.SelectSingleNode("WorkItemQuery/Wiql")

            Dim workItemsXml As Xml.XmlElement = myTfsClient.QueryWorkitems(xmlNode, sort, True, metaDataHave, asOfDate, dbStamp, metaData)
            Dim nodeReader As Xml.XmlNodeReader = New Xml.XmlNodeReader(workItemsXml)
            Dim returnXML As SqlXml = New SqlXml(nodeReader)
            MessageBox.Show(returnXML.Value)

But unfortunately the code didnt work it gave the security exception. Its correct i was running the code outside of my TFS server so it requires domain, username and pwd authentication. So i added the below code to supply the credential

            ”””” credential
            Dim cache As CredentialCache = New CredentialCache()
            cache.Add(New Uri(myTfsClient.Url), "Negotiate", New NetworkCredential(txtUser.Text, txtPwd.Text, txtDomain.Text))
            myTfsClient.Credentials = cache
            ”””
Now the security error is gone. But guess what i got following error “TF51313: The request ID is incorrect or not recognized”. I tried the other TFS Service http://localhost:8080/WorkItemTracking/v1.0/ExternalServices.asmx. It works without any error.

When i checked the SOAP message, the ClientService requires a RequestHeader in the SOAP header. The request header requires a valid id to be passed to call the clientservice methods. But the externalservices methods dont have such header info in the SOAP header so only this service works.

I posted in the forums hoping to get some clue http://social.expression.microsoft.com/Forums/en-US/tfsgeneral/thread/8d2b9618-1e83-4eee-ad87-e882977b7ec7?prof=required&wa=wsignin1.0 but no reply yet.

Hoping to crack down the issue soon…..