SlideShare a Scribd company logo
1 of 19
PictBridge Library Overview
Bear Lin
2009/04/28
Outline
System Overview
Flow of program running in Picture Bridge
TASK
fnPictProcess
Queue
DSC to Printer event dispatching
Printer to DSC events dispatching
fnFilterRecvData
Data Encapsulation, decap and routines
Printer Detection and initialzation
Printing Process
Picture Bridge
Library
Printer
AP Layer
Events: PICT_XXX
User Request
Events :
Printer Status
Request
Response
Event
System Overview
Communicate
with PTP
protocol
fnPictInit()
fnAppProcessInfoEvent()
fnPictProcess()
User Request
In Event form
Event from Printer
Flow of program running in Picture Bridge
DpsAPP
Dps
PTP
g_eAPP_DPSActionType :
DPS_ConfigurePrintService,
DPS_GetCapability,
DPS_StartJob, DPS_AbortJob,
DPS_ContinueJob,
Func = fnDPSOperation(),
fnDPSDiscovery()
fnPTPSendEventBlock(),
fnPTPSendDataBlock(),
fnPTPSendResponseBlock()
Request from DSC in event form
Flow of program running in Picture Bridge(cont.)
Notify from Printer in event form
g_ePRN_DPSActionType:
DPS_NotifyJobStatus,
DPS_NotifyDeviceStatus
Func = fnDpsPrinterReq()
fnPTPCheckCommandBlock(),
fnDPSGetContainerInfo(),
fnDPSGetMainObjectInfo(),
struct _Task
{
FuncPointer pFunc;
unsigned char ucTaskStatus;
unsigned char ucTaskStep;
unsigned char ucRestoreStep; // added for resend and ptp cancel
struct _Task *pCallerTask;
struct _Task *pCalledTask;
};
Double Link List
TASK
Task A Task B Task C
pCallerTask
pCalledTask
Func A Func B Func C
Step 1
:
Step N
Step 1
:
Step M
Step 1
:
Step I
DPSAPP DPS PTP
Scheduled by Pictprocess
RUN
BLOCK
or Job done, set
func to NULL
TASK(cont.)
fnProcessEvent()
fnUSBPeriodRoutine()
fnFilterRecvData()
if ( g_stUpPtp.pFunc != NULL && g_stUpPtp.ucTaskStatus == RUN )
( *g_stUpPtp.pFunc ) ( &g_stUpPtp );
Get and process event from DSC main system
Check incoming packet from USB, do data receive
if ( g_stDownPtp.pFunc != NULL && g_stDownPtp.ucTaskStatus == RUN )
( *g_stDownPtp.pFunc ) ( &g_stDownPtp );
if ( g_stUpDps.pFunc != NULL && g_stUpDps.ucTaskStatus == RUN )
( *g_stUpDps.pFunc ) ( &g_stUpDps );
if ( g_stUpDpsApp.pFunc != NULL && g_stUpDpsApp.ucTaskStatus == RUN )
( *g_stUpDpsApp.pFunc ) ( &g_stUpDpsApp );
if ( g_stDownDps.pFunc != NULL && g_stDownDps.ucTaskStatus == RUN )
( *g_stDownDps.pFunc ) ( &g_stDownDps );
if ( g_stDownDpsApp.pFunc != NULL && g_stDownDpsApp.ucTaskStatus == RUN )
g_stDownDpsApp.pFunc ( &g_stDownDpsApp );
Check Printer event, getFileInfo, getFile, getPartialFile
Process DPS,PTP,DpsApp
Upward, downward tasks.
Process Abort, Continue Task
fnPictProcess()
if ( ( g_stFileDps.pFunc != NULL ) && ( g_stFileDps.ucTaskStatus == RUN ) )
( *g_stFileDps.pFunc ) ( &g_stFileDps );
Queue
Queues : Queue(DSC to Printer), InfoQueue(Printer to DSC).
typedef struct _Event
{
unsigned char ucCode;
unsigned char aDataBuffer[MAX_EVENT_BUF_LEN];//89
unsigned int uiDataLength;
} Event;
typedef struct _InfoEvent
{
unsigned char ucCode;
unsigned char aDataBuffer[MAX_INFO_EVENT_BUF_LEN];//20
unsigned int uiDataLength;
} InfoEvent;
uiDataLength
ucCode
aDataBuffer[89]
Event:
uiDataLength
ucCode
aDataBuffer[20]
InfoEvent:
Queue(cont.)
typedef struct _Queue
{
Event aEventQueue[MAX_QUEUE_LEN];//3
unsigned char ucReadPointer;
unsigned char ucReadLock;
unsigned char ucWritePointer;
unsigned char ucWriteLock;
unsigned char ucDataLength;
unsigned char ucUrgeFlag;
} Queue;
RP, WP, RL, WL, DL
,UF
Queue:
fnBeforePutEvent()
fnAfterPutEvent()
fnBeforeGetEvent()
fnAfterGetEvent()
Queue(cont.)
extern Queue g_stInputQueue;
extern InfoQueue g_stOutputQueue;
typedef struct _InfoQueue
{
InfoEvent aEventQueue[MAX_INFO_QUEUE_LEN];//4
unsigned char ucReadPointer;
unsigned char ucReadLock;
unsigned char ucWritePointer;
unsigned char ucWriteLock;
unsigned char ucDataLength;
} InfoQueue;
RP, WP, RL, WL, DL
InfoQueue:
fnBeforePutInfoEvent()
fnAfterPutInfoEvent()
fnBeforeGetInfoEvent()
fnBeforeGetInfoEvent()
Put event in queue:
(1) fnBeforePutInfoEvent : 1.Check queue WrLock/Full? 2.Set WrLock. 3.Get WrPtr.
(2) FW put event and data in queue with this WrPtr.
(3) fnAfterPutInfoEvent : 1.Check queue WrLock. 2.Update WrPtr/DataLen. 3.Check WrPtr boundary.
4.Set WrLock False.
Queue(cont.)
Retrieve event in queue:
(1) fnBeforeGetInfoEvent : 1.Check queue RdLock/Empty? 2.Set RdLock. 3.Get RdPtr
(2) FW process event and data in queue with this RdPtr.
(3) fnAfterGetInfoEvent : 1.Check queue RdLock. 2.Update RdPtr/DataLen. 3.Check RdPtr boundary. 4.Set
RdLock False.
Event processing:
fnAppProcessInfoEvent(): Decode Printer to DSC events and dispatch.
fnProcessEvent() : Decode DSC to Printer events and dispatch.
RdPtr
WrPtr
fnProcessEvent()
PICT_PRINT
PICT_DPOF
PICT_CONFIGPICT_CAPAPICT_ABORT
PICT_CONTINUE
fnEventAbort()
fnEventGetCapability()
fnEventConfig()
fnExtParseDPOF()fnEventPrintImage()
fnEventContinue()
DSC to Printer event dispatching
PICT_PRINT_HUGEJOB_START
PICT_PRINT_HUGEJOB_CONTENT
fnEventBeforeHugePrint()
PICT_PRINT_HUGEJOB_END
fnEventBeforeHugePrintLast()
fnAppProcessInfoEvent()
ucCode
MSG_DETECT
MSG_OPERATIONFAIL
MSG_DEVICESTATUS
MSG_PRINTSERVICE
……..
g_stMsgDevStatus.ucJobEndReason
g_stMsgDevStatus.ucErrorStatus
g_stMsgDevStatus.ucErrorReasonMinor
Actions and
Message displaying
Events from printer
Printer to DSC events dispatching
g_stMsgDevStatus.ucErrorReason
fnFilterRecvData()
Request, Response and event
From printer.
Check PTP command
DPS_GetFileInfo DPS_GetFile DPS_GetPartialFile
DPS special optimized actions
fnDpsPrinterReq()
SendObjectInfo
Get XML scripts
XML deciphers :
fnDpsGetEventContent()…
Parameters
fnAppNotifyXXXStatus()
Application
layer
if ( ulObjectHandle > MIN_IMAGE_FILE_ID )
DPS_GetThumb
fnDpsGetFileInfo() fnDpsGetFile()
GetObjectInfo, GetObject
, GetPartialObject, GetThumb
Make sure this is Printer to DSC action
fnFilterRecvData()
Events for
fnAppProcessInfoEvent()
GetPartialObject
fnDpsGetFileInfo()GetObjectInfo fnGetFileInfo()
Printer
PTP DPS UI :
Implement at
Appilication layer
Response
Response
fnDpsGetPartialFile() fnReadFile()
Many times
File Type
File SIZE
File ID
ulOffset : offset
From start of file
uiSize : size data
ucBuffer : Buffer
Offset and Data
Size for each request
Event :
End Normal Job End
fnFilterRecvData()
: Dispatching printer request
fnFilterRecvData()(cont.)
Event PICT_XXX
and parameters
XML script
{ parameters}
PTP command +
{XML}
USB Header +
PTP command
Applications
DPS
PTP
USB
fnDPSConfigPrintServiceFormat()
fnDPSGetCapabilityFormat()
fnDPSGetJobStatusFormat()
fnDPSGetDevStatusFormat()
…………………….
fnPTPFormatDataBlock()
fnPTPFormatResponseBlock()
fnPTPFormatObjectInfo()
fnPTPFormatDeviceInfo()
…………………..
fnDPSGetOperateContent()
fnDPSGetEventContent()
fnDPSGetParamVal()
fnDPSGetContainerInfo()
: g_stContainerInfo
fnMiscDwordRead()
First 12 byte header
EncapsulationDecapsulation
Data Encapsulation, decap and routines
fnPictInit() : Assign DPS fnAppInitPrint() Task
PictProcess()
No printer found
fnDPSDiscovery()
Detected
DPS_ConfigurePrintService
fnAppGetCapa()
Application layer Detected
Event
Printer Detection and initialzation
UI: select
Picture + parameters
Issue :
PICT_PRINT Put Event
In queue
fnProcessEvent()
Get Event and dispatch
fnEventPrintImage()
g_eAPP_DPSActionType
: DPS_StartJob
fnDPSOperation()
PTP command, data,
Reponse sequence
USB
fnAppPrint()
Printing Process

More Related Content

Viewers also liked

OWASP CSRF Protector_Minhaz
OWASP CSRF Protector_MinhazOWASP CSRF Protector_Minhaz
OWASP CSRF Protector_MinhazOWASP Delhi
 
Mte3143 tugasan & rubrik kerja kursus
Mte3143 tugasan & rubrik kerja kursusMte3143 tugasan & rubrik kerja kursus
Mte3143 tugasan & rubrik kerja kursusRaohan Mohd
 
Fin tech innovation launches in continental europe forbes
Fin tech innovation launches in continental europe   forbesFin tech innovation launches in continental europe   forbes
Fin tech innovation launches in continental europe forbesLuis Rivera
 
Structure and function of haemoglobin
Structure and function of haemoglobinStructure and function of haemoglobin
Structure and function of haemoglobinKiruththikan Yogaraja
 
Seguridad, Salud y Medioambiente en la Minería presentación
Seguridad, Salud y Medioambiente en la Minería presentaciónSeguridad, Salud y Medioambiente en la Minería presentación
Seguridad, Salud y Medioambiente en la Minería presentaciónDavid Levy
 

Viewers also liked (7)

OWASP CSRF Protector_Minhaz
OWASP CSRF Protector_MinhazOWASP CSRF Protector_Minhaz
OWASP CSRF Protector_Minhaz
 
Taller de ecologia
Taller de ecologiaTaller de ecologia
Taller de ecologia
 
Ulasan jurnal KPT 6044
Ulasan jurnal KPT 6044Ulasan jurnal KPT 6044
Ulasan jurnal KPT 6044
 
Mte3143 tugasan & rubrik kerja kursus
Mte3143 tugasan & rubrik kerja kursusMte3143 tugasan & rubrik kerja kursus
Mte3143 tugasan & rubrik kerja kursus
 
Fin tech innovation launches in continental europe forbes
Fin tech innovation launches in continental europe   forbesFin tech innovation launches in continental europe   forbes
Fin tech innovation launches in continental europe forbes
 
Structure and function of haemoglobin
Structure and function of haemoglobinStructure and function of haemoglobin
Structure and function of haemoglobin
 
Seguridad, Salud y Medioambiente en la Minería presentación
Seguridad, Salud y Medioambiente en la Minería presentaciónSeguridad, Salud y Medioambiente en la Minería presentación
Seguridad, Salud y Medioambiente en la Minería presentación
 

Similar to PictBridge 05 - PictBridge Library Overview

ログ出力を改めて考える - JDK Flight Recorder の活用
ログ出力を改めて考える - JDK Flight Recorder の活用ログ出力を改めて考える - JDK Flight Recorder の活用
ログ出力を改めて考える - JDK Flight Recorder の活用Yoshiro Tokumasu
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareBrendan Gregg
 
Spark Streaming - Meetup Data Analysis
Spark Streaming - Meetup Data AnalysisSpark Streaming - Meetup Data Analysis
Spark Streaming - Meetup Data AnalysisSushmanth Sagala
 
PerfUG - Disruptor at ABC Arbitrage - March 2018
PerfUG - Disruptor at ABC Arbitrage - March 2018PerfUG - Disruptor at ABC Arbitrage - March 2018
PerfUG - Disruptor at ABC Arbitrage - March 2018Olivier Coanet
 
Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2Blueliv
 
Event sourcing in the functional world (22 07-2021)
Event sourcing in the functional world (22 07-2021)Event sourcing in the functional world (22 07-2021)
Event sourcing in the functional world (22 07-2021)Vitaly Brusentsev
 
Contiki introduction II-from what to how
Contiki introduction II-from what to howContiki introduction II-from what to how
Contiki introduction II-from what to howDingxin Xu
 
Kapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EngineKapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EnginePrashant Vats
 
Ejemplos Programas Descompilados
Ejemplos Programas DescompiladosEjemplos Programas Descompilados
Ejemplos Programas DescompiladosLuis Viteri
 
Glomosim adding routing protocol
Glomosim   adding routing protocolGlomosim   adding routing protocol
Glomosim adding routing protocolKathirvel Ayyaswamy
 
Apache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupApache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupStephan Ewen
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityBrendan Gregg
 
Config interface
Config interfaceConfig interface
Config interfaceRyan Boland
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20DefconRussia
 
Let CodeCommit work for you
Let CodeCommit work for youLet CodeCommit work for you
Let CodeCommit work for youJorisConijn
 

Similar to PictBridge 05 - PictBridge Library Overview (20)

ログ出力を改めて考える - JDK Flight Recorder の活用
ログ出力を改めて考える - JDK Flight Recorder の活用ログ出力を改めて考える - JDK Flight Recorder の活用
ログ出力を改めて考える - JDK Flight Recorder の活用
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
Spark Streaming - Meetup Data Analysis
Spark Streaming - Meetup Data AnalysisSpark Streaming - Meetup Data Analysis
Spark Streaming - Meetup Data Analysis
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
PerfUG - Disruptor at ABC Arbitrage - March 2018
PerfUG - Disruptor at ABC Arbitrage - March 2018PerfUG - Disruptor at ABC Arbitrage - March 2018
PerfUG - Disruptor at ABC Arbitrage - March 2018
 
Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2
 
Event sourcing in the functional world (22 07-2021)
Event sourcing in the functional world (22 07-2021)Event sourcing in the functional world (22 07-2021)
Event sourcing in the functional world (22 07-2021)
 
Contiki introduction II-from what to how
Contiki introduction II-from what to howContiki introduction II-from what to how
Contiki introduction II-from what to how
 
Kapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EngineKapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing Engine
 
PLM and Background Tasks by Jason Fox
PLM and Background Tasks by Jason FoxPLM and Background Tasks by Jason Fox
PLM and Background Tasks by Jason Fox
 
Ejemplos Programas Descompilados
Ejemplos Programas DescompiladosEjemplos Programas Descompilados
Ejemplos Programas Descompilados
 
Glomosim adding routing protocol
Glomosim   adding routing protocolGlomosim   adding routing protocol
Glomosim adding routing protocol
 
Apache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupApache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink Meetup
 
Vulkan 1.1 Reference Guide
Vulkan 1.1 Reference GuideVulkan 1.1 Reference Guide
Vulkan 1.1 Reference Guide
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
Config interface
Config interfaceConfig interface
Config interface
 
Winsock
WinsockWinsock
Winsock
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
 
Let CodeCommit work for you
Let CodeCommit work for youLet CodeCommit work for you
Let CodeCommit work for you
 

Recently uploaded

Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service ThanePooja Nehwal
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...Pooja Nehwal
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...ur8mqw8e
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaUnited Arab Emirates
 
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一ga6c6bdl
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...Pooja Nehwal
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一ga6c6bdl
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...Suhani Kapoor
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...Pooja Nehwal
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...nagunakhan
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gayasrsj9000
 

Recently uploaded (20)

Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
 
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一
定制宾州州立大学毕业证(PSU毕业证) 成绩单留信学历认证原版一比一
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一
如何办理萨省大学毕业证(UofS毕业证)成绩单留信学历认证原版一比一
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
 

PictBridge 05 - PictBridge Library Overview

  • 2. Outline System Overview Flow of program running in Picture Bridge TASK fnPictProcess Queue DSC to Printer event dispatching Printer to DSC events dispatching fnFilterRecvData Data Encapsulation, decap and routines Printer Detection and initialzation Printing Process
  • 3. Picture Bridge Library Printer AP Layer Events: PICT_XXX User Request Events : Printer Status Request Response Event System Overview Communicate with PTP protocol
  • 4. fnPictInit() fnAppProcessInfoEvent() fnPictProcess() User Request In Event form Event from Printer Flow of program running in Picture Bridge
  • 5. DpsAPP Dps PTP g_eAPP_DPSActionType : DPS_ConfigurePrintService, DPS_GetCapability, DPS_StartJob, DPS_AbortJob, DPS_ContinueJob, Func = fnDPSOperation(), fnDPSDiscovery() fnPTPSendEventBlock(), fnPTPSendDataBlock(), fnPTPSendResponseBlock() Request from DSC in event form Flow of program running in Picture Bridge(cont.) Notify from Printer in event form g_ePRN_DPSActionType: DPS_NotifyJobStatus, DPS_NotifyDeviceStatus Func = fnDpsPrinterReq() fnPTPCheckCommandBlock(), fnDPSGetContainerInfo(), fnDPSGetMainObjectInfo(),
  • 6. struct _Task { FuncPointer pFunc; unsigned char ucTaskStatus; unsigned char ucTaskStep; unsigned char ucRestoreStep; // added for resend and ptp cancel struct _Task *pCallerTask; struct _Task *pCalledTask; }; Double Link List TASK
  • 7. Task A Task B Task C pCallerTask pCalledTask Func A Func B Func C Step 1 : Step N Step 1 : Step M Step 1 : Step I DPSAPP DPS PTP Scheduled by Pictprocess RUN BLOCK or Job done, set func to NULL TASK(cont.)
  • 8. fnProcessEvent() fnUSBPeriodRoutine() fnFilterRecvData() if ( g_stUpPtp.pFunc != NULL && g_stUpPtp.ucTaskStatus == RUN ) ( *g_stUpPtp.pFunc ) ( &g_stUpPtp ); Get and process event from DSC main system Check incoming packet from USB, do data receive if ( g_stDownPtp.pFunc != NULL && g_stDownPtp.ucTaskStatus == RUN ) ( *g_stDownPtp.pFunc ) ( &g_stDownPtp ); if ( g_stUpDps.pFunc != NULL && g_stUpDps.ucTaskStatus == RUN ) ( *g_stUpDps.pFunc ) ( &g_stUpDps ); if ( g_stUpDpsApp.pFunc != NULL && g_stUpDpsApp.ucTaskStatus == RUN ) ( *g_stUpDpsApp.pFunc ) ( &g_stUpDpsApp ); if ( g_stDownDps.pFunc != NULL && g_stDownDps.ucTaskStatus == RUN ) ( *g_stDownDps.pFunc ) ( &g_stDownDps ); if ( g_stDownDpsApp.pFunc != NULL && g_stDownDpsApp.ucTaskStatus == RUN ) g_stDownDpsApp.pFunc ( &g_stDownDpsApp ); Check Printer event, getFileInfo, getFile, getPartialFile Process DPS,PTP,DpsApp Upward, downward tasks. Process Abort, Continue Task fnPictProcess() if ( ( g_stFileDps.pFunc != NULL ) && ( g_stFileDps.ucTaskStatus == RUN ) ) ( *g_stFileDps.pFunc ) ( &g_stFileDps );
  • 9. Queue Queues : Queue(DSC to Printer), InfoQueue(Printer to DSC). typedef struct _Event { unsigned char ucCode; unsigned char aDataBuffer[MAX_EVENT_BUF_LEN];//89 unsigned int uiDataLength; } Event; typedef struct _InfoEvent { unsigned char ucCode; unsigned char aDataBuffer[MAX_INFO_EVENT_BUF_LEN];//20 unsigned int uiDataLength; } InfoEvent; uiDataLength ucCode aDataBuffer[89] Event: uiDataLength ucCode aDataBuffer[20] InfoEvent:
  • 10. Queue(cont.) typedef struct _Queue { Event aEventQueue[MAX_QUEUE_LEN];//3 unsigned char ucReadPointer; unsigned char ucReadLock; unsigned char ucWritePointer; unsigned char ucWriteLock; unsigned char ucDataLength; unsigned char ucUrgeFlag; } Queue; RP, WP, RL, WL, DL ,UF Queue: fnBeforePutEvent() fnAfterPutEvent() fnBeforeGetEvent() fnAfterGetEvent()
  • 11. Queue(cont.) extern Queue g_stInputQueue; extern InfoQueue g_stOutputQueue; typedef struct _InfoQueue { InfoEvent aEventQueue[MAX_INFO_QUEUE_LEN];//4 unsigned char ucReadPointer; unsigned char ucReadLock; unsigned char ucWritePointer; unsigned char ucWriteLock; unsigned char ucDataLength; } InfoQueue; RP, WP, RL, WL, DL InfoQueue: fnBeforePutInfoEvent() fnAfterPutInfoEvent() fnBeforeGetInfoEvent() fnBeforeGetInfoEvent()
  • 12. Put event in queue: (1) fnBeforePutInfoEvent : 1.Check queue WrLock/Full? 2.Set WrLock. 3.Get WrPtr. (2) FW put event and data in queue with this WrPtr. (3) fnAfterPutInfoEvent : 1.Check queue WrLock. 2.Update WrPtr/DataLen. 3.Check WrPtr boundary. 4.Set WrLock False. Queue(cont.) Retrieve event in queue: (1) fnBeforeGetInfoEvent : 1.Check queue RdLock/Empty? 2.Set RdLock. 3.Get RdPtr (2) FW process event and data in queue with this RdPtr. (3) fnAfterGetInfoEvent : 1.Check queue RdLock. 2.Update RdPtr/DataLen. 3.Check RdPtr boundary. 4.Set RdLock False. Event processing: fnAppProcessInfoEvent(): Decode Printer to DSC events and dispatch. fnProcessEvent() : Decode DSC to Printer events and dispatch. RdPtr WrPtr
  • 13. fnProcessEvent() PICT_PRINT PICT_DPOF PICT_CONFIGPICT_CAPAPICT_ABORT PICT_CONTINUE fnEventAbort() fnEventGetCapability() fnEventConfig() fnExtParseDPOF()fnEventPrintImage() fnEventContinue() DSC to Printer event dispatching PICT_PRINT_HUGEJOB_START PICT_PRINT_HUGEJOB_CONTENT fnEventBeforeHugePrint() PICT_PRINT_HUGEJOB_END fnEventBeforeHugePrintLast()
  • 15. fnFilterRecvData() Request, Response and event From printer. Check PTP command DPS_GetFileInfo DPS_GetFile DPS_GetPartialFile DPS special optimized actions fnDpsPrinterReq() SendObjectInfo Get XML scripts XML deciphers : fnDpsGetEventContent()… Parameters fnAppNotifyXXXStatus() Application layer if ( ulObjectHandle > MIN_IMAGE_FILE_ID ) DPS_GetThumb fnDpsGetFileInfo() fnDpsGetFile() GetObjectInfo, GetObject , GetPartialObject, GetThumb Make sure this is Printer to DSC action fnFilterRecvData() Events for fnAppProcessInfoEvent()
  • 16. GetPartialObject fnDpsGetFileInfo()GetObjectInfo fnGetFileInfo() Printer PTP DPS UI : Implement at Appilication layer Response Response fnDpsGetPartialFile() fnReadFile() Many times File Type File SIZE File ID ulOffset : offset From start of file uiSize : size data ucBuffer : Buffer Offset and Data Size for each request Event : End Normal Job End fnFilterRecvData() : Dispatching printer request fnFilterRecvData()(cont.)
  • 17. Event PICT_XXX and parameters XML script { parameters} PTP command + {XML} USB Header + PTP command Applications DPS PTP USB fnDPSConfigPrintServiceFormat() fnDPSGetCapabilityFormat() fnDPSGetJobStatusFormat() fnDPSGetDevStatusFormat() ……………………. fnPTPFormatDataBlock() fnPTPFormatResponseBlock() fnPTPFormatObjectInfo() fnPTPFormatDeviceInfo() ………………….. fnDPSGetOperateContent() fnDPSGetEventContent() fnDPSGetParamVal() fnDPSGetContainerInfo() : g_stContainerInfo fnMiscDwordRead() First 12 byte header EncapsulationDecapsulation Data Encapsulation, decap and routines
  • 18. fnPictInit() : Assign DPS fnAppInitPrint() Task PictProcess() No printer found fnDPSDiscovery() Detected DPS_ConfigurePrintService fnAppGetCapa() Application layer Detected Event Printer Detection and initialzation
  • 19. UI: select Picture + parameters Issue : PICT_PRINT Put Event In queue fnProcessEvent() Get Event and dispatch fnEventPrintImage() g_eAPP_DPSActionType : DPS_StartJob fnDPSOperation() PTP command, data, Reponse sequence USB fnAppPrint() Printing Process