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

Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
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
 
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberCall Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberMs Riya
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版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
 
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
 
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
 
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls KolkataCall Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
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
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...Amil baba
 
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一zul5vf0pq
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...Suhani Kapoor
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...ranjana rawat
 
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
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...nagunakhan
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Pooja Nehwal
 
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
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查awo24iot
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointGetawu
 
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
 

Recently uploaded (20)

🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
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...
 
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberCall Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版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学...
 
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
 
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
 
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls KolkataCall Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
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...
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
 
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...
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
 
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...
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power point
 
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...
 

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